Web Design and Development Forums

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


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

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Jan 21st, 2008, 17:46   #1 (permalink)
Reputable Member
 
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
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!
__________________
My w3 blog: w3hobbyist.com
RohanShenoy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 21st, 2008, 18:31   #2 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
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.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 21st, 2008, 19:05   #3 (permalink)
Reputable Member
 
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
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!
__________________
My w3 blog: w3hobbyist.com

Last edited by RohanShenoy; Jan 21st, 2008 at 19:08.
RohanShenoy is offline  
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
Rate This Thread
Rate This Thread:

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] XML > MySQL? alexgeek PHP Forum 13 Jan 5th, 2008 10:45
[SOLVED] Clear:both does not works in IE6 attila001122 CSS Forum 10 Dec 30th, 2007 14:43
[SOLVED] Xampp Problem Stormraven Apache and IIS 14 Nov 10th, 2007 20:34
[SOLVED] MySQL! crackafaza Apache and IIS 6 Nov 8th, 2007 15:23
webhost cyclone2876 Hosting & Domains 7 Jun 30th, 2007 12:02



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 17:30.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59