LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-04-2006, 07:14 AM   #1
mosedrengen
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.

Thanks,

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

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
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.


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

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

template_tags
template_menu
menu_items

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
mosedrengen
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.
 
  


Reply


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


All times are GMT -5. The time now is 05:49 AM.

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