Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-06-2007, 01:15 PM   #1
Baseband Member
 
Join Date: Sep 2006
Posts: 62
Default SQL problem

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 Code:
<?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
__________________

bigggnick is offline   Reply With Quote
Old 04-06-2007, 04:32 PM   #2
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: SQL problem

What errors are you getting?
__________________

__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 04-06-2007, 10:30 PM   #3
Baseband Member
 
Join Date: Sep 2006
Posts: 62
Default Re: SQL problem

PHP Code:
Parse errorsyntax errorunexpected T_WHILE in /home/nickgcom/domains/nickscomputing.com/public_html/sql.php on line 20 
bigggnick is offline   Reply With Quote
Old 04-09-2007, 11:34 AM   #4
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: SQL problem

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 ?
__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 04-15-2007, 08:33 PM   #5
Fully Optimized
 
UK31337's Avatar
 
Join Date: Feb 2005
Posts: 2,776
Default Re: SQL problem

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.
UK31337 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:38 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0