for and UPDATE command to work, which i have made worked using my PRIMARY KEY id now, do you have to use the Primary key?
does it have to be a key?
can it be a unique key then?
if not then why is .php?username=$username not working right?
and in my update script i have
$query = "UPDATE users SET (Year='$Year',
etc etc etc
WHERE username=$username)";
and username is entered into the form.... the exact way I got the id way to update..
next question
how do you display all the records in a database?
how can you count the number of records in a database?
my ohter database, which is a very nice script and i'm very proud of 🙂
needs a few new options one being, display all the records.
now
my tables are all set as Makes of cars.. Acura, Ford, Chvery etc etc etc lot's of them
and one of the fields is Model
how can I make a search that shows all results for model?
i've been trying thsi way, with no apparent luck
<?
include("db.php");
if ($searchstring) {
$query = "SELECT * FROM $make WHERE $searchtype LIKE '%$searchstring%' ORDER BY Mod_Name ASC";
$searchstring = $searchtype;
$result = mysql_query($query, $mysql_access);
while ($row = mysql_fetch_array($result))
{
echo "<p aligncenter>";
echo "Mod Name:<a href=\"result/$make.php?id=".$row["0"]."\"> ".$row["4"]."</a>";
}
echo "</p>";
i have a working search set up almost the same way... here's that working script
<?
include("db.php");
if ($searchstring)
{
$query = "SELECT * FROM $make WHERE $searchtype LIKE '%$searchstring%' ORDER BY Mod_Name ASC";
$result = mysql_query($query, $mysql_access);
echo "Search results:";
while ($row = mysql_fetch_array($result))
{
echo "<table width=675 border=1 bordercolor=black borderstyle=solid align=center>";
echo "<tr><b>Mod Name:</b><a href=\"result/$make.php?id=".$row["0"]."\"> ".$row["4"]."</a>";
}
echo "</tr></table>";
thanks for reading and thanks for your help 🙂