Mysql Help - Hot To Display Or Show MYSQL Query Errors Results PHP Scripts

Mobile
feeds
Welcome Login | Register

Mysql Help - Hot To Display Or Show MYSQL Query Errors Results PHP Scripts
  Forums Index
      » MYSQL Forums
        » » Mysql Help - Hot To Display or Show MYSQL Query Errors Results PHP Scripts



Mysql Help - Hot To Display Or Show MYSQL Query Errors Results PHP Scripts
Post Description:
Post Tags: mysql, help, hot, to, display, or, show, mysql, query, errors, results, php, scripts, mysql database, support, help, answers, questions, help
This Post Has Been Viewed 1654 Times Since Wed Apr 04, 2007 9:18 pm Posted By hostman with 1 replies
Mysql Help - Hot To Display Or Show MYSQL Query Errors Results PHP Scripts
ok, today i was running a script to insert some data into my mysql database, i kept running the script but it just wouldn't insert the data i was entering on my HTML form through my PHP Script. Then I remember that you can actually display MYSQL errors with the mysql_error() fucntion in php.

this was my query how it looked like:


     Code:
$sql = "INSERT INTO my_table(this and,this) values ('$this','$and','$this')";
$result = mysql_query($sql ,$database);


i kept looking at my query to see if there were any errors, but i didn't catch anything wrong.

So i finally had to do something, i put the mysql_error() to display (or show) if there were any errros on my MYSQL query. so i changed the code to this:
     Code:
$sql = "INSERT INTO my_table(this and,this) values ('$this','$and','$this')";
if($result = mysql_query($sql))
{
echo "<h1>SUCESS</h1>";
}
else
{
echo "ERROR: ".mysql_error()."<BR>";
}


so now when i ran my script, i got it to display the error, and this is what it said:
     Code:
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and, thisp at line 3


GOTCHA!! did you see my mistake? if you notice on my $sql after my_table(this i need to put a comma after "this" so this is how my $sql shoule look like:
     Code:
$sql = "INSERT INTO my_table(this,and,this) values ('$this','$and','$this')";
$result = mysql_query($sql ,$database);


After I corrected this, the script was able to insert all the data from my from into mysql database.



     Quote:
1064 you have an error in your sql syntax you have an error in your sql syntax near 1064 you have an error in your sql syntax near you have an error in your sql syntax check you have an error in your sql syntax php forum you have an error in your sql syntax php 1064 you have an error in your sql syntax check sql order by order by syntax php syntax sql tutorial sql update sql delete sql count syntax database select sql sql where sql date sql set update syntax sql database select syntax sql function sql tables sql property of wallpaperama.com query delete syntax user error sql create sql table count syntax set syntax syntax tutorial table syntax syntax function create syntax where syntax date syntax sql server script syntax query syntax module error you where where have mysql_error php mysql_error die mysql_error or die mysql_error insert into mysql_error in lmysqlclient order by phpmyadmin mysql_query php fopen localhost _get _post smarty isset zend gcc postgresql echo innodb url syntax null apache blob mail scripts javascript foreach xml perl pear php5 redirect auto_increment explode odbc var php4 include array db arrays sessions cookie parse linux timestamp database string property of wallpaperama.com date tables query script functions select session variables delete header tutorials id insert values table login ini variable connect howto post password function documentation print create update tutorial empty class count if set user read server simple form field replace row connection limit example output get multiple return where 4.1 into MYSQL Query Errors mysql query error mysql query browser error syntax error missing operator in query expression syntax error in date in query expression syntax error in query incomplete query clause query of queries syntax error syntax error in string in query expression error executing database query macromedia property of wallpaperama.com sqlserver jdbc driver syntax error in query expression microsoft access driver syntax error missing operator in query expression syntax error in string in query syntax error in query 1064 you have an error in your sql syntax you have an error in your sql syntax you have an error in your sql syntax near sql syntax error microsoft odbc sql server driver syntax error or access violation 1064 you have an error in your sql syntax near sql server syntax error converting datetime from character string error in your sql syntax near engine myisam you have an error in your sql syntax php forum error in sql syntax odbc sql server property of wallpaperama.com driver count field incorrect or syntax error sql server syntax error converting the varchar value error in your sql syntax odbc sql server driver syntax error or access violation you have an error in your sql syntax php microsoft odbc sql server driver sql server syntax error mysql insert into insert into query mysql alter table mysql order by mysql auto increment mysql primary key mysql temporary table property of wallpaperama.com mysql foreign key sql server syntax error mysql left join mysql not null mysql reference manual query alter table 1064 you have an error in your sql syntax check odbc sql server driver syntax error error in your sql syntax near syntax error missing operator in query left join query order by query not null query you have an error in your sql syntax check



Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About Mysql Help - Hot To Display Or Show MYSQL Query Errors Results PHP Scripts




:: 1 :: Reply #12867 Reply By Lili On Fri Jul 27, 2007 11:43 am
i cant connect to sqlserver from oracle sql developer.
i know that is possible. but i dont find com.sqlserver.jdbc.driver. can you help me?

thnaks

kisses