whitepony6767 Posted December 7, 2006 Share Posted December 7, 2006 I have these same scripts running on my personal webserver, however they will not run on a network solutions hosted server.Please anyone help me if you can.here is a super basic example... and the error that i get.<?$bio=mysql_query("SELECT text FROM about_bio LIMIT 1");$bio=mysql_fetch_array($bio);$bio_text = stripslashes($bio['text']);?>mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data/12/1/117/46/1117209/user/1178384/htdocs/about.php on line 3 Quote Link to comment https://forums.phpfreaks.com/topic/29775-having-issue-with-simple-script-running-on-a-network-solutions-server/ Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 Do you have a db connection? Its always a good idea to use:mysql_query($query) or die(mysql_error()); So you can see exactly where it went wrong. Quote Link to comment https://forums.phpfreaks.com/topic/29775-having-issue-with-simple-script-running-on-a-network-solutions-server/#findComment-136738 Share on other sites More sharing options...
whitepony6767 Posted December 7, 2006 Author Share Posted December 7, 2006 here is the connection info from the main page...the index.php includes the other php files.i have changed the connection info as to not give out my login information.<?php$dbh=mysql_connect ("<IP of server>", "<admin login>", "<admin password>") or die ('I cannot connect to the database because: ' . mysql_error());mysql_select_db ("main"); //Gets server varsif (!empty($_SERVER)) extract($_SERVER);//Gets get (query string) varsif (!empty($_GET)) {extract($_GET);} else if (!empty($HTTP_GET_VARS)) {extract($HTTP_GET_VARS);}//Gets post (form method=post) varsif (!empty($_POST)) {extract($_POST);} else if (!empty($HTTP_POST_VARS)) {extract($HTTP_POST_VARS);}$date = date("Y-m-d H:i:s"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/29775-having-issue-with-simple-script-running-on-a-network-solutions-server/#findComment-136740 Share on other sites More sharing options...
the_oliver Posted December 7, 2006 Share Posted December 7, 2006 Have to ask the odvious, is your php compiled with mysql function support? Quote Link to comment https://forums.phpfreaks.com/topic/29775-having-issue-with-simple-script-running-on-a-network-solutions-server/#findComment-136777 Share on other sites More sharing options...
whitepony6767 Posted December 7, 2006 Author Share Posted December 7, 2006 hmmm... I am not sure.I have written all these scripts in a text editor and uploaded them. I have never had to compile any of the code.is there something that I am missing, or a set of functions that I need include?thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/29775-having-issue-with-simple-script-running-on-a-network-solutions-server/#findComment-136933 Share on other sites More sharing options...
the_oliver Posted December 7, 2006 Share Posted December 7, 2006 If its on hosting then it allmost sertinatly will. When you origionaly set up a web server, it is not nessesery to have all the php moduals installed. Its sort of an optional extra realy. For example most webservers will not suport pg_ connections by default. You will find that although alot of people use it, you still have to specificly install the options.Like i said though if your on paied hosting it almost sertinatly be configered.**sorry just noticed you said your on paid hosting on the first post!Perhaps you could try putting something allong these lines above your first $bio (the queiry). [code]if ( ! $link )die( "Couldn't connect to MySQL" );mysql_select_db( $main )or die ( "Couldn't open $db: ".mysql_error() );[/code]other thing that might be worth a try is adding ' before and after each part: eg:[code]SELECT 'text' FROM 'about_bio' LIMIT 1(not sure if the 1 would need it or not). [/code] It unlikly but some systems, espesialy the older version can insist on it?Let me know how it goes. Quote Link to comment https://forums.phpfreaks.com/topic/29775-having-issue-with-simple-script-running-on-a-network-solutions-server/#findComment-136991 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.