SQL problem

bigggnick

Baseband Member
Messages
62
hey,
so im making a site, www.nickscomputing.com , and i want a points system. Members will be rewarded with points when they write a good article. So i made a new column called points, and a test file to echo the points. Here is that test file:
PHP:
<?php
$con = mysql_connect("localhost","username","*************");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("smf_members", $con);

$result = mysql_query("SELECT points FROM smf_members
WHERE memberName='Nick'");
while($row = mysql_fetch_array($result))
  {
  echo $row['memberName'] . " has " . $row['points'];
  echo "<br />";
  }

?>

Whats wrong with this? All i get are errors, with and without the @ in front of whe while.

If anyone wants to get first-hand access to the files and wants to help me further, email me and i'll give you ftp access.
email: bigggnick@gmail.com
 
PHP:
Parse error: syntax error, unexpected T_WHILE in /home/nickgcom/domains/nickscomputing.com/public_html/sql.php on line 20
 
That is a strange error, what version of mysql are you running, because I know that php5, at least the last time I checked, didn't play nice with the newest version of mySql, there may be some syntax differences, or it might not like the underscore in your select statement, although I can't imagine why. Also, are you enforcing referential integrity in your mysql database(after the create table tableName(column1 int, primary)type=innodb;) ?
 
Exactly which one's line 20? Might help me to point it out, I don't think referential integrity isv what the problem is here, it's a syntax error within the code itself.
 
Back
Top Bottom