seany02 Posted April 24, 2009 Share Posted April 24, 2009 Im trying to spread information accross three pages. On the first page I have a form the collects a specific id. On the second page a table is generated displaying in brief the information from the dbtable. And on the third page more detailed data is displayed still using the id from the first page... Roughly. The following is the code i'm using $name=$_Post["secondtxt"]; $db = @mysql_connect("localhost","root",""); if (!$db) { do_error("Could not connect to the server"); } // Connect to the database @mysql_select_db("Rufus" ,$db)or do_error("Could not connect to the database"); // Run query $result = mysql_query("SELECT * FROM project WHERE projectid='$name' ORDER BY projectid",$connect); while($myrow = mysql_fetch_array($result)) { echo "<b>Project ID: "; echo $myrow['projectid']; echo "</b><br>Project Name: <i>"; echo $myrow['projectname']; echo "</i><hr align=left width=160>"; echo $myrow['projectdescription']; echo "<br><a href=\"pro_details.php?projectid=$myrow[projectid]\">Read More...</a>"; } ?> Currently i'm getting two parse errors from this: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\xampp\htdocs\newsearch.php on line 62 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\newsearch.php on line 63 line 62 starts at $result. Any help would be appreciated! Link to comment https://forums.phpfreaks.com/topic/155551-getting-data-from-a-table-using-form-information-from-a-different-page/ Share on other sites More sharing options...
rckehoe Posted April 24, 2009 Share Posted April 24, 2009 It looks like your mysql queries are not correct... You have: $result = mysql_query("SELECT * FROM project WHERE projectid='$name' ORDER BY projectid",$connect); it should be: $result = mysql_query("SELECT * FROM project WHERE projectid='$name' ORDER BY projectid"); I don't believe you need the $connect variable at the end of the query statement... I never do it like that anyway... Tye it, and it should clear up your issues. Make sure you correct any other query calls and take out the $connect variable. This is the only that that I spotted while briefly looking over your code. Link to comment https://forums.phpfreaks.com/topic/155551-getting-data-from-a-table-using-form-information-from-a-different-page/#findComment-818611 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.