Can anyone please tell me why this wont insert into a mysql table

I have connected to the table, i have checked this using a select statement, I have also checked that my username can insert new records but i just cant make it work

$insertQuery = "INSERT INTO tblbooking (',bookingNumber', 'memberNumber', 'activity') VALUES (,$memberNumber,$Activity)";
mysql_query($insertQuery) or die("Insert Failed!");

Any help would be very useful

    Bob,

    I'm pretty new to PHP and MySQL, but I have done insertions before.

    I am a little skeptical about the leading commas that you have after VALUES(',xxxxxx','xxxxx'). My statements are VALUES('xxx',xxx')

    Also, my question to you is about the INTO $tb...(', are you actually declaring the table and defining it each time you want to insert a new record?

    -Donald

      Bob,

      if you don't know which value bookingNumber will have, e.g. because it's auto-incrementing, leave it out of the list.

      you don't need quotes around column names, but make sure you use them for any value that is not a number.

      and let mysql_error() tell you what's wrong, it is usually more helpful than "Insert Failed!".

      $insertQuery = "INSERT INTO tblbooking (memberNumber, activity) VALUES ($memberNumber,'$Activity')"; 
      mysql_query($insertQuery) or die(mysql_error()); 
      
        Write a Reply...