Jump to content

Having issue with simple script running on a network solutions server


whitepony6767

Recommended Posts

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

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 vars
if (!empty($_SERVER))
extract($_SERVER);

//Gets get (query string) vars
if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
}

//Gets post (form method=post) vars
if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
}

$date = date("Y-m-d H:i:s");
?>
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.
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.