Follow us on Twitter!
You cannot teach a man anything; you can only help him find it within himself. - Galileo
Monday, April 27, 2015
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 27
Guests Online: 23
TeamSpeak Online : 5 Members Online: 4

Registered Members: 88078
Newest Member: sourav kumar
Latest Articles
Our sponsor needs your help!


One of our sponsors needs your help, http://www.virginmediabusiness.co.uk/pitch-to-rich/grow/krystal-hosting/
Go check out their video and Don't forget to vote !


~ Thanks for your help
HBH
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

Mysql Row data php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-08-07 19:22
Heya guys, Im trying to make a points system for my site ..
All i need now .. is to echo them :P Sounds simple yea .. But i cant seem to get the sql bit right ..
Ive tried loooads of different things .... But this is my most recent attempt
Code

<?php
function dbarray($query) {
   $result = @mysql_fetch_assoc($query);
   if (!$result) {
      echo mysql_error();
      return false;
   } else {
      return $result;
   }
}
function dbrows($query) {
   $result = @mysql_num_rows($query);
   return $result;
}
$un = $_SESSION['session_user'];
mysql_connect("localhost", "root", "***********") or die(mysql_error());
mysql_select_db("cms") or die(mysql_error());
$query = "SELECT * FROM users WHERE username=$un";
$result = mysql_query($query);
if (dbrows($result)) { $data = dbarray($result); }
$req_points = $data->points;
echo "req_points";
?>







Edited by on 09-08-07 19:41
Author

RE: Mysql Row data php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-08-07 19:32
Can you remove smilies and post an output,

You are also missing an $ on the final echo


Author

RE: Mysql Row data php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-08-07 19:42
smilies removed in above post ^ ....
And yea i changed that but still ahve my prob ...
The last bit was an ad-lib for example anyway .. but carry on ..


Author

RE: Mysql Row data php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 11-08-07 00:11
replace
Code

if (dbrows($result)) { $data = dbarray($result); }
$req_points = $data->points;
echo "req_points";
?>




if
Code

$data = mysql_fetch_object($result);
$req_points = $data->points;
echo "$req_points";
?>