Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-04-2006, 07:14 AM   #1
LQ Newbie
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
PHP/MYSQL problem. Rename of table-name solves the problem...

I am running a CentOS 4.2 with Apache 2.0 and PHP 4.3.9

The problem is I get a lot of php notice: undefined index, and the page does not show correctly.

The weird thing is if I copy a mysql table into a new one with a new name, and change the php-code to use the new table... It works !!

If I then rename the new table back to the old tablename it does not work again.

It works fine on another server (redhat 8.0) with apache 1.3 and php 4.3.8

I have even tried php.ini values from the server that works. This does not help.

I hope someone know whats going on, because I will be very sad of changing all my code to new tablenames.


Old 01-05-2006, 04:29 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Would help to know the names ...

Anyway: MySQL allows for a couple of "stupid" table-names,
reserved words and the like. Most of the time you can fix
that by putting the names in quotes.

Old 01-06-2006, 06:24 AM   #3
LQ Newbie
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Some of the table-names are:


There are more, but have not tested all tables.

If I rename template_tags to template_tag, it works. It seems kind of weird to me ??

If I use print_r() after using a tablename that does not work I get weird output:

Array ( [] => 1 )

If I change table-name I get correct output with print_r() function.

Last edited by mosedrengen; 01-06-2006 at 06:28 AM.
Old 01-06-2006, 07:07 AM   #4
LQ Newbie
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
I have just tried to connect to the database with a mysql client. The SQL-queries I use in my code executes without errors here, so I think the problem is in php.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL table question newuser455 Programming 10 11-03-2005 04:50 AM
table views problem (MySQL ODBC OOo) landroni Linux - Software 0 08-19-2005 03:00 PM
Problem inserting data into a mysql table using PHP Rockgod2099 Programming 13 08-03-2005 12:27 AM
Problem with mysql table name mitrship Programming 2 07-25-2005 07:12 AM
ctrl/alt f1 solves my touchpad problem - why? tgarland Linux - Hardware 6 07-02-2003 09:43 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration