maddcow26 Posted September 24, 2008 Share Posted September 24, 2008 I tried (emphasis on TRIED) to make a real simple script to display all info in a db. Below is the code: <? php require_once ('2008formincludes/mysql_connect.php'); $query="SELECT * FROM formresults"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Database Output</center></b><br><br>"; $i=0; while ($i < $num) { $qname=mysql_result($result,$i,"qname"); $qemail=mysql_result($result,$i,"qemail"); $qaddress=mysql_result($result,$i,"qaddress"); $burlap=mysql_result($result,$i,"burlap"); $gender=mysql_result($result,$i,"gender"); $primarystyle=mysql_result($result,$i,"primarystyle"); $yearsprimary=mysql_result($result,$i,"yearsprimary"); $yearsgrappling=mysql_result($result,$i,"yearsgrappling"); $weekly=mysql_result($result,$i,"weekly"); $stephanquestion=mysql_result($result,$i,"stephanquestion"); $visitorsince=mysql_result($result,$i,"visitorsince"); $$dvdpurchase=mysql_result($result,$i,"dvdpurchase"); echo "<b>Name:$qname</b><br>Email: $qemail<br>Age: $burlap<br>Gender: $gender<br>Primarystyle: $primarystyle<br><hr><br>"; $i++; } ?> When attempting to access the page I get the following error: Parse error: syntax error, unexpected T_REQUIRE_ONCE in /home/jgrapple/public_html/2008results.php on line 3 Any ideas? as best I can tell, my syntax is all correct and I can't see any reason why line 3 is a problem, i just want to connect to my db before running the query... what am I missing? Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted September 24, 2008 Share Posted September 24, 2008 require_once ('2008formincludes/mysql_connect.php'); require_once doesn't require parenthases.. or however you spell that... these "()" to be around the thing to be required.. Quote Link to comment Share on other sites More sharing options...
maddcow26 Posted September 24, 2008 Author Share Posted September 24, 2008 thanks, but same error shows up Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 24, 2008 Share Posted September 24, 2008 <?php is one tag (no space between <? and php) 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.