Jump to content

mysql help


joecooper

Recommended Posts

Not much to go on there!

 

$s = "SELECT * FROM users";
$res = mysql_query($s, $conn) or die(mysql_error());

$num_rows = mysql_num_rows($res);

while ($a = mysql_fetch_array($res))
{
$funds = $a['funds'];
}

 

or

 

$s = "SELECT * FROM users";
$res = mysql_query($s, $conn) or die(mysql_error());

$num_rows = mysql_num_rows($res);
if($num_rows==1)
{
$a = mysql_fetch_array($res)
$funds = $a['funds'];
}

Link to comment
https://forums.phpfreaks.com/topic/104102-mysql-help/#findComment-532950
Share on other sites

i have had some to drink so now is probally not the best time for me to try coding...

 

but what you said i think is wrong... this is what im trying but not working

 

 

$sql = "SELECT * FROM users WHERE username=$username";

$result = mysql_query($sql);

$funds=$result['funds'];

  echo("Funds: $funds");

Link to comment
https://forums.phpfreaks.com/topic/104102-mysql-help/#findComment-532961
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.