Jump to content

[SOLVED] Verify info was placed in db...


jmac2501

Recommended Posts

I get an error saying that there is no $end

 

Here is what i have

$sql = "INSERT INTO listings (`streetaddress`, `city`, `price`, `squarefeet`, `bed`, `Fbath`, `Hbath`, `reo`, `agent`, `pic`)
VALUES ('$streetaddress','$city','$price','$squarefeet','$bed','$Fbath','$Hbath','$REO','$agent','$pic')";
echo("$sql");
mysql_query($sql);
if(mysql_query($sql))
{
     echo "Success!";
header("Location: http://sacvalleyhomes.com/Members/add.htm"); 
}
else {
    echo "Error!!!";
header("Location: http://sacvalleyhomes.com/Members/add2.htm"); 
}

?>

Here is what i have

<?php
$sql = "INSERT INTO listings (`streetaddress`, `city`, `price`, `squarefeet`, `bed`, `Fbath`, `Hbath`, `reo`, `agent`, `pic`)
VALUES ('$streetaddress','$city','$price','$squarefeet','$bed','$Fbath','$Hbath','$REO','$agent','$pic')";
//echo("$sql"); <-no
//mysql_query($sql);
if(mysql_query($sql))
{
     //echo "Success!"; <-header must be sent before any output. so don't echo anything
header("Location: http://sacvalleyhomes.com/Members/add.htm"); 
}
else {
    //echo "Error!!!"; <-header must be sent before any output. so don't echo anything
header("Location: http://sacvalleyhomes.com/Members/add2.htm"); 
}

?>

 

and I don't see where $end fits into here, so make those changes, and see what happens

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.