fizzzgigg Posted December 29, 2010 Share Posted December 29, 2010 Why doesn't this code work? I can't figure it out. Database information: DB: abelltx table: homework Fields in table: id, pid, uid, name, url, approved, comment, SubmissionTime <?PHP $link = mysql_connect('xxxxxx', 'xxxxx', 'xxxxxxx') or die(mysql_error()); mysql_select_db("abelltx", $link) or die(mysql_error()); $uid=abelltx $query = "SELECT DISTINCT name FROM homework ORDER BY id ASC"; $result = query_db($query); while ($myrow = mysql_fetch_array($result)) { echo $myrow[name].", "; } ?> I get the following error: "Parse error: syntax error, unexpected T_VARIABLE in D:\Hosting\5366560\html\test.php on line 6" Quote Link to comment Share on other sites More sharing options...
Zurev Posted December 29, 2010 Share Posted December 29, 2010 Edit your post to remove the database information, anyone can access your database at this point and do anything to it. $uid is missing a semi-colon, and your $myrow[name] needs to be $myrow['name']. Quote Link to comment Share on other sites More sharing options...
fizzzgigg Posted December 29, 2010 Author Share Posted December 29, 2010 Fixed it thank you so much!!!! Quote Link to comment Share on other sites More sharing options...
fizzzgigg Posted December 29, 2010 Author Share Posted December 29, 2010 Seriously now my db is gone! F@#$#@$ bull#@## Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.