By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,819 Members | 1,433 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,819 IT Pros & Developers. It's quick & easy.

Why do I get zero sized reply???

P: n/a
Why after running the following script do I get zero sized reply??
It seems to hang when I access the $link_id (when comparing it, negating,
reading and so on) but it isn't an expected behaviour. Any clues??
Pawel Galecki
include "";

$link_id = db_connect();
if(!$link_id) die(sql_error());
else echo "Successfully made a connection to $dbhost.<BR>";

$dbhost = 'localhost';
$dbusername = 'phpuser';
$dbuserpassword = 'phppass';
$default_dbname = 'mysql';


function db_connect() {
global $dbhost, $dbusername, $dbuserpassword, $default_dbname;

$link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
if(!$link_id) {
$MYSQL_ERROR = "Connection failed to the host $dbhost.";
return 0;
else if(empty($dbname) && !mysql_select_db($default_dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
else return $link_id;

function sql_error() {

if(empty($MYSQL_ERROR)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.