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" Link to comment https://forums.phpfreaks.com/topic/222876-code-error/ 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']. Link to comment https://forums.phpfreaks.com/topic/222876-code-error/#findComment-1152446 Share on other sites More sharing options...
fizzzgigg Posted December 29, 2010 Author Share Posted December 29, 2010 Fixed it thank you so much!!!! Link to comment https://forums.phpfreaks.com/topic/222876-code-error/#findComment-1152448 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#@## Link to comment https://forums.phpfreaks.com/topic/222876-code-error/#findComment-1152449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.