
03-09-10, 11:04 AM
|
|
Wannabe Coder
|
|
Join Date: Dec 2008
Posts: 143
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
|
PHP help
Hey,
My code is below:
PHP Code:
<?php
$cat = $_GET['offers'];
if($cat == ""){
$SearchResult = mysql_query("SELECT * from offers ORDER BY `title` ASC LIMIT " . ($page-1)*$Limit . ",$Limit") or die(mysql_error());
}else{
$SearchResult = mysql_query("SELECT * FROM offers WHERE categoryID = '$cat' LIMIT " . ($page-1)*$Limit . ",$Limit") or die(mysql_error());
}
while($list = mysql_fetch_array( $SearchResult )){
$textotemplate = new TextOfferReplace;
$textotemplate->load("template/includes/offershtml.php");
$textotemplate->replace("oid", $list['id']);
$textotemplate->replace("uid", file_get_contents ("template/includes/userid.php"));
$textotemplate->replace("title", $list['title']);
$textotemplate->replace("link", $list['link']);
$textotemplate->replace("offercredit", $list['amount']);
$textotemplate->replace("image", $list['image']);
$textotemplate->replace("credittime", $list['credittime']);
$textotemplate->replace("description", $list['description']);
$textotemplate->replace("requirements", $list['requirements']);
$textotemplate->publish();
}
?>
I would it so that when offercredit is called it uses the code below instead of $list['amount'].
How could I do this?
Thanks.
|