Jump to content

parse error


maddcow26

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.