devang23 Posted December 7, 2009 Share Posted December 7, 2009 for some reason this script continues to give me a mysql syntax PHP Error Message Parse error: syntax error, unexpected T_STRING in /home/a3213677/public_html/workpart2.php on line 10 <html><head><title>I'm a GENUIS</title></head> <body> <?php $conn=mysql_connect("mysql4.000webhost.com","a3213677_dolphin","******") or die(mysql_error()); $rs = mysql_select_db("a3213677_snorre", $conn) or die("NOOOPE"); $sql="SELECT * FROM `User Table`; $rs=mysql_query($sql,$conn) or die(mysql_error());; $list = "<table border=\"1\" cellpadding=\"2\">"; $list.="<tr><th><First Name</th>"; $list.="<th>Last Name</th>"; $list.="<th>UserName</th>"; $list.="<th>PassWord</th></tr>"; while($row= mysql_fetch_array($rs) ) { $list .= "<tr>"; $list .= "<td>".$row["first_name"]."</td>"; $list .= "<td>".$row["last_name"]."</td>"; $list .= "<td>".$row["username"]."</td>"; $list .= "<td>".$row["password"]."</td>"; $list .= "</tr>"; } $list .= "<\table"; echo($list); ?> </body><html> Link to comment https://forums.phpfreaks.com/topic/184301-mysql-not-working/ Share on other sites More sharing options...
rajivgonsalves Posted December 7, 2009 Share Posted December 7, 2009 your missing a quotes, this is a php error not mysql $sql="SELECT * FROM `User Table`; should be $sql="SELECT * FROM `User Table`"; Link to comment https://forums.phpfreaks.com/topic/184301-mysql-not-working/#findComment-972990 Share on other sites More sharing options...
premiso Posted December 7, 2009 Share Posted December 7, 2009 That and please do not put titles in all caps (for more information why read the rules #2 under forum guidlines), it is so annoying. Thanks. Link to comment https://forums.phpfreaks.com/topic/184301-mysql-not-working/#findComment-972994 Share on other sites More sharing options...
fenway Posted December 9, 2009 Share Posted December 9, 2009 Or double-post. Topic locked. Link to comment https://forums.phpfreaks.com/topic/184301-mysql-not-working/#findComment-974324 Share on other sites More sharing options...
Recommended Posts