I am running the script below, and it pulls the data based on the mysql_num_rows, and the $var1 variable. However, it does not pass any of the other variables. Here is the script: PHP: --------- $submission = $_POST["siteurl"]; $dbh = mysql_connect("localhost", "username", "password") or die('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("database"); $sql = "SELECT var1, var2, var3 FROM ads WHERE url = '$submission' LIMIT 1"; $result = mysql_query($sql, $dbh) or die(mysql_error()); while ($newArray = mysql_fetch_array($result)) $var1 = $newArray[ "var1" ]; $var2 = $newArray[ "var2" ]; $var3 = $newArray[ "var3" ]; if (mysql_num_rows($result) < 1) { echo "Not found"; } else { { } if ( $var1 == "1" ) { echo "Message 1 $var2
$var3"; } elseif ( $var1 == "3" ) { echo "Message 2 $var3"; } elseif ( $var1 == "0" ) { echo "Message 3"; } elseif ( $var1 == "4" ) { echo "Message 4 $var3; }} --------- This only outputs the messages, not including the echoed variables. Does anyone know what's happening here? How can I fix this?
More...