Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-10-2005, 06:04 AM php/mysql error
Average Talker

Posts: 15
Trades: 0
I am currently trying to create a blog and have come as far as learning php/mysql (I already new perl so it wasn't hard to learn)

In development, the site I have at the current stage works fine, *but* when I upload it to a PHP enabled webserver, it seems to fail on some of my SQL querys and that kills the whole page.

the page works when I comment out the code

Code:
$query = "SELECT DISTINCT LEFT(EntryDate, 7) AS DistinctMonths FROM Entries ORDER BY EntryDate DESC";
$results = mysql_query($query) or die('/nError query (query 4) failed');
$monthcount = 0;
and that is the first peice of code that is throwing up the 'die' error

secondly when I comment that last peice out, the code

Code:
$query = "SELECT Eid, EntryTime, EntryDate, EntryTitle,  MusicTitle, MusicArtist, Body FROM entries ORDER BY EntryDate DESC, EntryTime DESC LIMIT $offset, $entrycount";
$result = mysql_query($query) or die('/nError query (query 5) failed');
runs, but also throws up the 'die' error.

If anyone can help me and explain why this is then I would be throughly grateful...
bennyboywonder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-10-2005, 08:33 AM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
Try changing your die statement to
PHP Code:
die (mysql_error()) 
This way you'll see the actuall reason why your query is failing.
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 06-10-2005, 08:35 AM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
Also consider running your query in phpMyAdmin in the SQL area -- it can be a very useful tool for debugging queries with excellent error reporting.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 06-10-2005, 09:46 AM
Average Talker

Posts: 15
Trades: 0
thanks for your replies guys. Perhaps I was a little too hasty to scream for help. After doing a bit of debugging, I discovered that the local mySQL server I had been testing it on was not case-sensitive, but the remote ones were, and I had gotten the case wrong in a few of the sql queries
bennyboywonder is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php/mysql error
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13473 seconds with 12 queries