- Forums
- General Errors
- Notice: Use of undefined constant id assumed 'id' in index.php on line
This Page Contains information about Notice: Use of undefined constant id assumed 'id' in index.php on line By apache in category General Errors with 1 Replies. [2601], Last Updated: Sat May 18, 2024
apache
Mon Jun 30, 2008
1 Comments
6577 Visits
the error that im getting is this.
Notice: Use of undefined constant name- assumed 'name' in /home/www/public_html/forums/index.php on line 473
Notice: Use of undefined constant title - assumed 'title' in /home/www/public_html/forums/index.php on line 473
Notice: Use of undefined constant id - assumed 'id' in /home/www/public_html/forums/index.php on line 473
i just moved my wallpaper website to a dedicated server i leased from you guys and for some reason i seeing a bunch of errors i was not seeing on when i had my shared hosting with another company.
i thought by having a dedicated server i would be incontrol of my website, but now i see is that im getting so many error.
please help me fix this
$sql = 'SELECT * FROM forums ORDER BY id DESC'
by doing the above query, im selecting all the fields but im not using them all of the arrays variables so thats why i get this display error. so you can do two things. instead of doing a query with wild card, just select the fields you are going to need. for example, i only need the id,name,title of the forums table. so this is how my query would look like:
$sql = 'SELECT id,name,title FROM forums ORDER BY id DESC'
see the difference.. its all about good coding. it also helps your server reduce cpu resources if you stop using the wild card on your queries. or if you dont want to edit your code, you can do this other option to get rid of this error:
edit your php.ini file
go to the shell, login as root and enter these commands:
open php.ini
look for this line:
replace it with this:
saved your changes: Hit Control-x
at the prompt: Do you want to save changes... say YES
now reboot your apache server:
DONE - now you shouldn't be getting these errors. if you still get them, then you did something wrong. make sure you followed these steps carefuly. if you still have problems reply and i will investigate more for you. make sure to enter the errror you are getting.