Results 1 to 3 of 3

Thread: Query Was Empty- error after inseting data into database

  1. #1
    Join Date
    Apr 2009
    Posts
    90

    Query Was Empty- error after inseting data into database

    I used MySQL query to insert some fields into phpadmin database, the query was also very simple but whenever i used an launch that query it simply passed on me the error message saying that "query is empty".

    I used the following query to insert field into my database.
    Code:
    $_SESSION['authour']="yes";
    $logname = $_POST['Firstusername'];
    $_SESSION['logname'] = $logname;
    $today = date("Y-m-d h:m:s");
    After defining the variable I passed the following parameters to insert into an database.

    Code:
    $sql = "INSERT INTO Member (loginName, loginTime) VALUES ('$logname', '$today')";
    echo "$logname, $today";
    mysql_query($sq1) or die(mysql_error());
    what would be the problem where it goes wrong please help.

  2. #2
    Join Date
    Mar 2008
    Posts
    258

    Re: Query Was Empty- error after inseting data into database

    This may happen that whenever you wanted to pointed towards some records at that time your actual pointer may directed to the different location and that location may be consider as the null pointer of empty pointer from the programming point of view. Here in your case it seems that your query would be stored in '$sql' (ESS-QUE-ELL), but mysql_query is trying to call '$sq1' (ESS-QUE-ONE).

  3. #3
    Join Date
    Apr 2008
    Posts
    193

    Re: Query Was Empty- error after inseting data into database

    I will ask you to run your MySQL command for one more time, if it still gives you the same problem then switch over to postgre sql which will be the next best option to show you the error reporting and will assist in debugging the situation. or else you just need to consider it replacing your javascript functions with PHP ones since JS can sometimes interfere with MySQL result sets and PHP provide superior client side scripting anyway.

Similar Threads

  1. Interrogating database with the query in MySQL
    By Xiomar in forum Software Development
    Replies: 3
    Last Post: 21-12-2010, 05:41 AM
  2. Empty reports in TMG using SQL server Express database
    By Trini Alvarado in forum Windows Software
    Replies: 4
    Last Post: 05-04-2010, 05:49 PM
  3. Query for columns in oracle database
    By Gerri in forum Windows Software
    Replies: 4
    Last Post: 10-02-2010, 08:27 PM
  4. Php database query
    By garfield1 in forum Software Development
    Replies: 3
    Last Post: 05-12-2009, 01:40 PM
  5. SQL query to delete a row in database
    By Connect_Me in forum Software Development
    Replies: 3
    Last Post: 05-05-2009, 01:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,055,002.12987 seconds with 17 queries