Hi,
I gotta dum kweschin.
Here's muh code:
[code=php]
class dbServer{
...
public function &executeDBCOMMA ND($SQL=";"){
$result = mysql_query($SQ L);
}
public function connect(){
echo 'Connecting to server ' . $this->servername . '<br>';
$this->dbconnection = mysql_connect($ this->servername,$th is->username,$th is->password);
if(!$this->dbconnection ){
throw new Exception("did not connect");
}
return true;
}
...
}
$s=$d=$t="x";
$s = new dbServer("local host","__MUNGED __","__MUNGED__ ") or die ("no dbserver");
if($s<>'x') $s->connect() or die ("no dbserver");
if($s<>'x') $d = new dbDatabase("__M UNGED__") or die ("no database");
if($d<>'x') $d->connect() or die ("no database");
if($d<>'x') $t = new dbTable("Table1 ") or die("no table");
if($t<>'x')
{
try{
$result =& $s->executeDBCOMMA ND("show tables;");
///////////////////////////////////////////////////////////////
//LINE 184 (where the error is)
///////////////////////////////////////////////////////////////
$num=mysql_numr ows($result) or die('<hr />MySQL Error: '
.mysql_error(). '<hr />');
///////////////////////////////////////////////////////////////
...
}
catch{...}
...
}
?>
[/code]
So when I run it, I get the following error:
Warning: mysql_numrows() : supplied argument is not a valid MySQL result resource in /nfsexport/var/www/doc_root/info/no-ip/yourwebsite/jpenney/phpfiles/fieldlib.php on line 184
I think it's a problem with returning the reference, but I'm not sure. Any hints?
Thanks,
JP
I gotta dum kweschin.
Here's muh code:
[code=php]
class dbServer{
...
public function &executeDBCOMMA ND($SQL=";"){
$result = mysql_query($SQ L);
}
public function connect(){
echo 'Connecting to server ' . $this->servername . '<br>';
$this->dbconnection = mysql_connect($ this->servername,$th is->username,$th is->password);
if(!$this->dbconnection ){
throw new Exception("did not connect");
}
return true;
}
...
}
$s=$d=$t="x";
$s = new dbServer("local host","__MUNGED __","__MUNGED__ ") or die ("no dbserver");
if($s<>'x') $s->connect() or die ("no dbserver");
if($s<>'x') $d = new dbDatabase("__M UNGED__") or die ("no database");
if($d<>'x') $d->connect() or die ("no database");
if($d<>'x') $t = new dbTable("Table1 ") or die("no table");
if($t<>'x')
{
try{
$result =& $s->executeDBCOMMA ND("show tables;");
///////////////////////////////////////////////////////////////
//LINE 184 (where the error is)
///////////////////////////////////////////////////////////////
$num=mysql_numr ows($result) or die('<hr />MySQL Error: '
.mysql_error(). '<hr />');
///////////////////////////////////////////////////////////////
...
}
catch{...}
...
}
?>
[/code]
So when I run it, I get the following error:
Warning: mysql_numrows() : supplied argument is not a valid MySQL result resource in /nfsexport/var/www/doc_root/info/no-ip/yourwebsite/jpenney/phpfiles/fieldlib.php on line 184
I think it's a problem with returning the reference, but I'm not sure. Any hints?
Thanks,
JP
Comment