Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

MySQL Insert with PHP

Name: Anonymous 2010-12-17 11:05

I can't figure this out. Something is wrong with my SQL insert statement, and I have no idea what it is. (I also tried setting the variables for all of the values to be input, ie $city = "test" but that didn't work either...halp!)


<form method="POST" action="hw8b.php">
    Name:<br />
    <input type="text" name="name1" /><br /><br />
    City:<br />
    <input type="text" name="city" /><br /><br />
    Email:<br />
    <input type="text" name="email" /><br /><br />
    <input type="submit" value="Insert">
    </form>



<?php

$DBConnect = mysql_connect("localhost", "howard", "");

if (! $DBConnect)
{
  echo "<P>Database not available";
}

$_POST["howard"];
$_POST["password"];

$name1 = $_POST["name1"];
$city = $_POST["city"];;
$email = $_POST["email"];

mysql_select_db("myDB");

$SQLstring = "SELECT MAX(ID) FROM FANS";
$QueryResult = mysql_query($SQLstring);
$Row = mysql_fetch_row($QueryResult);
$fanID = $Row[0] + 1;

$SQLstring = "INSERT INTO FANS VALUES(" . $fanID . ",'" . $name1 . "','" . $city . "','" . $email . "');";

$QueryResult = mysql_query($SQLstring);

Name: Anonymous 2010-12-17 16:14

>>10

Dude I've added over 9000 quotes, removed quotes, tried different quotes, done a bunch of random shit...

if I put shit to select * from fans; and output it for each row incremented... it PRINTS the table. I know 100% that it's loading the table. I can't get it to FUCKING INSERT NO MATTER WHAT I FUCKING TRY TO PUT.

I've followed the goddamned links and tried a bunch of shit, none of which WORKS. I don't get why the insert doesn't work. I've tried fucking everything.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List