[SOLVED] PHP-MySQL sitw not woking on webhost, but works on XAMPP

This is a discussion on "[SOLVED] PHP-MySQL sitw not woking on webhost, but works on XAMPP" within the PHP Forum section. This forum, and the thread "[SOLVED] PHP-MySQL sitw not woking on webhost, but works on XAMPP are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 21st, 2008, 17:46
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow [SOLVED] PHP-MySQL sitw not woking on webhost, but works on XAMPP

Hello people,
I got this strange problem.
I have created a website that does not work with my webhost but works on my local machine when I use XAMPP.

Configuration:
webhost: PHP: 4.4.7 MySQL: 4.1.22 - standard
XAMPP: PHP: 5.2.4 MySQL: 5.0.45

I get the error Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/biology/public_html/demo/register.php on line 9

It amazes me that the site works smooth on my local machine.

Do you think this problem is due to version difference?
If yes, then can someone suggest PHP and MySQL 5 webhosts?

Thank you!

Just in case you need the URL its demo.biologyformhtcet.com!
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 21st, 2008, 18:31
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: PHP-MySQL sitw not woking on webhost, but works on XAMPP

I think the actual function is mysql_num_rows() but from the error you are receiving I'd guess that the query is not be executed.
Where you have: mysql_query(query string); change it to:
PHP: Select all

mysql_query(querystringhere) or die(mysql_error()); 

This will show any errors with the query.
Have you put in the right database connection string for your server? The connection for your localhost and the connection for your server will be different no doubt.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 21st, 2008, 19:05
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP-MySQL sitw not woking on webhost, but works on XAMPP

[SOLVED]
Well guys, the problem is solved. I think it was compatibility issues of PHP and MySQL because I tested it on a PHP 5 and MySQL 5 webhost (http://www.whost.in) and got it to work without any hassles.

Thanks Alex for taking the time.
Quote:
Originally Posted by alexgeek View Post
I think the actual function is mysql_num_rows() but from the error you are receiving I'd guess that the query is not be executed.
Where you have: mysql_query(query string); change it to:
PHP: Select all

mysql_query(querystringhere) or die(mysql_error()); 

This will show any errors with the query.
Have you put in the right database connection string for your server? The connection for your localhost and the connection for your server will be different no doubt.
Yes, I confirmed every thing(what you said) including privileges of the MySQL db user. All was correct!
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)

Last edited by RohanShenoy; Jan 21st, 2008 at 19:08.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Clear:both does not works in IE6 attila001122 Web Page Design 10 Dec 30th, 2007 14:43
Xampp nashultz07 Databases 6 Aug 4th, 2007 20:49
webhost cyclone2876 Hosting & Domains 7 Jun 30th, 2007 12:02
What webhost to use ? amandeep Hosting & Domains 3 May 28th, 2006 15:51


All times are GMT. The time now is 20:33.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved