Results 1 to 2 of 2

Thread: SQL problem

  1. #1
    Join Date
    Aug 2010
    Posts
    7

    Default SQL problem

    I have 3 problems that are making me crazy.
    First I want to declare that I am not an expert, I am a beginner, but I am reading a lot about it.
    All the users i created has the privileges to insert, update and select. With a "SELECT" y I don't have any problems, but if I insert I get some. I checked all this querys in DreamCoder for Mysql and they work properly.

    my first code:
    <?php
    mysql_select_db("bd",$staff);
    $query = "INSERT INTO bares (datos) VALUES ('datos')";
    mysql_query($query,$madrindie)or die("Query failed:$query");

    ?>

    Answer:
    Query failed:INSERT INTO bares (datas) VALUES ('datas')

    The user has the privileges, and the funny thing is that in my computer it's works. I have to say that I installed Apache on my computer to make some proves before upload the php files. Is there anything on php.ini file that i didn't check?

    ----------------------------------------------------------------------------------
    The second problem is with an UPDATE

    mysql_select_db("bd",$bd);
    $query = "UPDATE bares SET fecha_actualizacion ='$fecha_actualizacion' WHERE dato= '".$dato."'";
    mysql_query($query,$madrindie)or die("Query failed:$query");

    answer:
    Query failed:UPDATE bares SET fecha_actualizacion ='2010-08-19' WHERE dato=''

    I don't why it didn't recognise dato, which is an ULR variable.

    ----------------------------------------------------------------------------------

    The last one is with have

    I have a function which check email in an contact form. It is work on my computer and here does not do anything. Like I doesn't exist. Any idea?

    Thanks a lot for the help

  2. #2
    Join Date
    Aug 2010
    Posts
    7

    Default

    Solved.

    The java thing was problem between windows and linux.

    The query thingi don't know bus i used a variable to call the database insted os "" and it works.

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •