Page 2 of 2
Php how-to for starters
Posted: Wed Oct 13, 2004 3:34 pm
by Anonymous
i am doing a php on euoropean lycos and i get an error when using this code: 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" the first line of the code... can' anyone help!!!
Archived topic from Iceteks, old topic ID:1560, old post ID:22538
Php how-to for starters
Posted: Wed Oct 13, 2004 4:32 pm
by Red Squirrel
It means you have a syntax error in your mysql query, unfortunatly mysql is not very helpful at telling WHAT the error is, so you'll have to figure that part out. Post the query and maybe I can look at it and find the problem.
Archived topic from Iceteks, old topic ID:1560, old post ID:22539
Php how-to for starters
Posted: Tue Nov 16, 2004 2:13 pm
by Red Squirrel
You need to run it off a webserver that has php installed.
So you would type
http://serverhost/script.php
Archived topic from Iceteks, old topic ID:1560, old post ID:23278
Php how-to for starters
Posted: Thu Jun 09, 2005 10:36 pm
by halojoy
Yes, it is nice with scripts that does note produce notices.
isset is a good way to avoid this,
if you do not want to add a lot of code that sets 'empty' values for variables
Another way is to TURN OFF reporting of NOTICE
you add this, at top (beginning) of your php pages:
Code: Select all
<?php
// Report ALL, but not NOTICE
error_reporting ( E_ALL & ~E_NOTICE );
// You will still get WARNINGS and other real ERRORS
// Notice is not an error, just a note
// To not have to add it in all your pages you can make it a line in 'config.php' ,
// if you have such a file, that is included by php pages
?>[code]I use E_ALL = reporting with notices only when working with my code
When I am finished and put my code on website, I Turn Notice OFF, using that line.
I do not want to scare my visitors :lol:
[color=#888888][size=85]Archived topic from Iceteks, old topic ID:1560, old post ID:27352[/size][/color]