I've made this script to query my database (done in MySql) via url:
<?php
$db = mysql_connect("localhost", "");
mysql_select_db("archive",$db);
$result = mysql_query("select * from mytable where ID= $ID",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "<table border=1>n";
echo "<tr><td>Name</td><td>Position</td></tr>n";
do {
printf("<tr><td>%s %s</td><td>%s</tr>n", $myrow["fieldone"], $myrow["fieldtwo"], $myrow["fieldthree"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>n";
} else {
echo "Sorry, no records were found!";
}
?>
The only working field is ID (Unique,Primary). All the other filelds generete a query error.
http://www.mysite.com/test.php?ID=34 works
http://www.mysite.com/test.php?fieldone=pippo doesn't work.
Any help is appreciated!
Thanks in advance!
Abe