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? Link to comment https://forums.phpfreaks.com/topic/125688-parse-error/ 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.. Link to comment https://forums.phpfreaks.com/topic/125688-parse-error/#findComment-649908 Share on other sites More sharing options...
maddcow26 Posted September 24, 2008 Author Share Posted September 24, 2008 thanks, but same error shows up Link to comment https://forums.phpfreaks.com/topic/125688-parse-error/#findComment-649911 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) Link to comment https://forums.phpfreaks.com/topic/125688-parse-error/#findComment-649943 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.