Jump to content

slate

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by slate

  1. Figured it out myself...

    There\'s a bug in mysql (according to mysql.com) so I have to do this:

     

    $valsToInsert = \"\";

     

    if ($point_id != \"\")

    {

    $valsToInsert = $valsToInsert . \"\'$point_id\'\";

    }

    else

    {

    $valsToInsert = $valsToInsert . \"NULL\";

    }

     

    for each $string i need to check it.

  2. CREATE DATABASE your_db;

     

    CREATE TABLE `yourtable` ( `code` INT(9) NOT NULL AUTO_INCREMENT, `parentcode` INT(9) NULL , `title` VARCHAR(30) NULL , `description` VARCHAR(30) NULL , `uname` VARCHAR(30) NULL , `email` VARCHAR(30) NULL , UNIQUE ( `code` ) );

  3. In this piece of a line of code:

     

    $result = sql_query(\"INSERT INTO map_points VALUES (\'$point_id\', \'$point_title\', \'$point_desc\', etc...

     

     

    it $point_title is empty (null) in the form, and the default value is NULL, why is it being inserted as 0 into the database?

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