I’ll keep it short and sweet
here is my class:
[code=php]
<?php
//db connection
include(“../inc/conn.php”);
class getBody{
public $query;
public $defaultQuery;
public $rs;
private $result;
public function buildBody(){
//print $string;
//$query = ” SELECT * FROM texts WHERE Title = ‘$string’ “;
$result = mysql_query($query)or die(mysql_error());
if ( mysql_num_rows($result)>0 ){
$row = mysql_fetch_array($result);
$rs = $row[‘Content’];
}else{
//$query = ” SELECT * FROM texts WHERE Title = ‘Default'”;
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$rs = $row[‘Content’];
}
}
}
?>
here is the call:
[code=php]
$body = new getBody;
$body->query = ” SELECT * FROM texts WHERE Title = ‘$page’ “;
$body->defaultQuery = ” SELECT * FROM texts WHERE Title = ‘Default'”;
//$query = ” SELECT * FROM texts WHERE Title = ‘$string’ “;
//$query = ” SELECT * FROM texts WHERE Title = ‘Default'”;
$body->buildBody();
here is the reply:
[QUOTE]
Query was empty
what am i doing wrong?
Thanks ?