Jump to content

Recommended Posts

Hey, i am having trouble finding out how i can verify that the data that i inserted into my db realy got there, and if it did to redirect me to another page. and if the data didn't get inserted to re-direct me to a diffrent page.

 

Any kind of code you could show me would be great.

Link to comment
https://forums.phpfreaks.com/topic/53356-solved-verify-info-was-placed-in-db/
Share on other sites

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.