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

Link to comment
Share on other sites

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");
?>
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.