I need some serious help. I have been posting in multiple forums with no real help. I need to access a single row of a database table in MySQL quering from PHP. This single field will be from the string in the URL such as www.whatever.com/verify.php?id=1 will display the information from row 1 only and www.whatever.com/verify.php?id=2 will display the information from row 2 only.
I have tried everything I can think of and tried to work with what others have told me, and I am still getting parsing errors. Now my errors occur in the while line.
Here is my code that I have been working with:
<?php
$user = "mastero4_verify";
$pass = "*******";
$db = "mastero4_verify";
$link = mysql_connect( "localhost", $user, $pass );
if ( ! $link )
die( "Couldn't connect to MySQL" );
mysql_select_db( $db, $link )
or die( "Couldn't open $db: ".mysql_error() );
$result = mysql_query( "SELECT url FROM table WHERE id = $id" );
print "<table border=0>\n";
while ( $a_row = mysql_fetch_row( $result ) ) {
print "<tr><td>Matrix ID </td><td>".$a_row['id']."</td></tr>\n";
print "<tr><td>Matrix Name </td><td>".$a_row['name']."</td></tr>\n";
print "<tr><td>Main URL </td><td>".$a_row['url']."</td></tr>\n";
print "<tr><td>Date Joined </td><td>".$a_row['date']."</td></tr>\n";
print "<tr><td>Unresolved Investigations </td><td>".$a_row['unresolved']."</td></tr>\n";
print "<tr><td>Resolved Investigations </td><td>".$a_row['resolved']."</td></tr>\n";
print "<tr><td>Date of Last Investigation </td><td>".$a_row['datelast']."</td></tr>\n";
}
print "</table>\n";
mysql_close( $link );
?>
Thanks in advance.