Jump to content


Photo

Mysql retrieving data


  • Please log in to reply
2 replies to this topic

#1 RTS

RTS
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 24 August 2006 - 02:38 AM

I am having a problem retreiving data from my mysql database. cann someone tell me what might be wrong? heres my code
<html>
<body bgcolor="336699">
<?php
$con = mysql_connect("localhost","ZackBabtkis","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("test", $con);
$result = mysql_query("SELECT about FROM users WHERE username = Zack");
while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . echo $row['about'] . "</td>";
  echo "</tr>";
  }
echo "</table>";
mysql_close($con);
?>
</body>
</html>


#2 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 24 August 2006 - 03:21 AM

$con = mysql_connect("localhost","ZackBabtkis","");
Wouldn't you need -something- on the last quotations? =)

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 August 2006 - 04:02 AM

cann someone tell me what might be wrong?


Why not explain what you see, what you don't see, what you would like to happen, what error messages (if any) you get, etc. .... and try where username = 'Zack'
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users