Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-05-2009
Member
 
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.
Reply With Quote
  #2  
Old 18-05-2009
Member
 
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).
Reply With Quote
  #3  
Old 18-05-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Query Was Empty- error after inseting data into database"
Thread Thread Starter Forum Replies Last Post
Interrogating database with the query in MySQL Xiomar Software Development 3 21-12-2010 05:41 AM
Empty reports in TMG using SQL server Express database Trini Alvarado Windows Software 4 05-04-2010 05:49 PM
Query for columns in oracle database Gerri Windows Software 4 10-02-2010 08:27 PM
Php database query garfield1 Software Development 3 05-12-2009 01:40 PM
SQL query to delete a row in database Connect_Me Software Development 3 05-05-2009 01:45 PM


All times are GMT +5.5. The time now is 01:55 AM.