Jump to content


Photo

Need help duplicating script


  • Please log in to reply
3 replies to this topic

#1 zachishi

zachishi
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 27 April 2006 - 04:38 PM

Please view this code and tell me if there is a way to duplicate the center section that is in red.

<?php
include_once("includes/startup.php");
$cat=$_GET['id'];
$query="SELECT * FROM ".TABLE_PREFIX."categories WHERE cat_id='$cat'";
if(isset($_GET['pool']) && $_GET['pool']!='')
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]{
$qry1='AND with_pool=1 ';
}else{
$qry1='';
}[!--colorc--][/span][!--/colorc--]
$rs=$conn->Execute($query);
$arr=$rs->fields;
$query1="SELECT id,pname,sleep,type,thumb FROM ".TABLE_PREFIX."properties WHERE type='$cat' $qry1 order by q_id desc";
//print $query1;
$rs1=$conn->Execute($query1);
$test=$rs1;
$image_count=$test->RecordCount();
?>


This section calls some information that is displayed in another page. I need to duplicate this on this page and let them co-exist. Is this possible. I have tryed every way i know how and cant get it to work. I am very new at this and am working off a site someone else created. Please help

#2 piznac

piznac
  • Members
  • PipPipPip
  • Advanced Member
  • 261 posts

Posted 27 April 2006 - 07:32 PM

[!--quoteo(post=369276:date=Apr 27 2006, 12:38 PM:name=zachishi)--][div class=\'quotetop\']QUOTE(zachishi @ Apr 27 2006, 12:38 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Please view this code and tell me if there is a way to duplicate the center section that is in red.

<?php
include_once("includes/startup.php");
$cat=$_GET['id'];
$query="SELECT * FROM ".TABLE_PREFIX."categories WHERE cat_id='$cat'";
if(isset($_GET['pool']) && $_GET['pool']!='')
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]{
$qry1='AND with_pool=1 ';
}else{
$qry1='';
}[!--colorc--][/span][!--/colorc--]
$rs=$conn->Execute($query);
$arr=$rs->fields;
$query1="SELECT id,pname,sleep,type,thumb FROM ".TABLE_PREFIX."properties WHERE type='$cat' $qry1 order by q_id desc";
//print $query1;
$rs1=$conn->Execute($query1);
$test=$rs1;
$image_count=$test->RecordCount();
?>
This section calls some information that is displayed in another page. I need to duplicate this on this page and let them co-exist. Is this possible. I have tryed every way i know how and cant get it to work. I am very new at this and am working off a site someone else created. Please help
[/quote]

Dont know if this is what you need. But you can typically just rename the variable and repeat the same if statement. i.e.

if(isset($_GET['pool']) && $_GET['pool']!='')
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]{
$qry1='AND with_pool=1 ';
}else{
$qry1='';
}[!--colorc--][/span][!--/colorc--]

if(isset($_GET['pool']) && $_GET['pool']!='')
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]{
$qry2='AND with_pool=1 ';
}else{
$qry2='';
}[!--colorc--][/span][!--/colorc--]

then change the variable when it is called. Really need to see all the code. But this might work for you.


#3 zachishi

zachishi
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 28 April 2006 - 03:11 PM

what other code do you need to see.

[a href=\"http://www.eaglesridge.com/property.php\" target=\"_blank\"]http://www.eaglesridge.com/property.php[/a]
[a href=\"http://www.eaglesridge.com/with_pool.php\" target=\"_blank\"]http://www.eaglesridge.com/with_pool.php[/a]

Do i need to put this in another page or just below this query. I tryed this but wouldn't work.
{
$qry1='AND with_pool=1 ';
$qry2='AND pet=1 ';
}else{
$qry1='';
$qry2='';
}

It is being called in [a href=\"http://www.eaglesridge.com/pet.php\" target=\"_blank\"]http://www.eaglesridge.com/pet.php[/a] . Which is very similar to [a href=\"http://www.eaglesridge.com/with_pool.php\" target=\"_blank\"]http://www.eaglesridge.com/with_pool.php[/a]

I am just trying to make a pet friendly page and the pet tag is already setup in the MYSQl. I just can't seem to get it to call/display in the pHP. Thanks





#4 piznac

piznac
  • Members
  • PipPipPip
  • Advanced Member
  • 261 posts

Posted 01 May 2006 - 08:04 PM

[!--quoteo(post=369613:date=Apr 28 2006, 11:11 AM:name=zachishi)--][div class=\'quotetop\']QUOTE(zachishi @ Apr 28 2006, 11:11 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
what other code do you need to see.

[a href=\"http://www.eaglesridge.com/property.php\" target=\"_blank\"]http://www.eaglesridge.com/property.php[/a]
[a href=\"http://www.eaglesridge.com/with_pool.php\" target=\"_blank\"]http://www.eaglesridge.com/with_pool.php[/a]

Do i need to put this in another page or just below this query. I tryed this but wouldn't work.
{
$qry1='AND with_pool=1 ';
$qry2='AND pet=1 ';
}else{
$qry1='';
$qry2='';
}

It is being called in [a href=\"http://www.eaglesridge.com/pet.php\" target=\"_blank\"]http://www.eaglesridge.com/pet.php[/a] . Which is very similar to [a href=\"http://www.eaglesridge.com/with_pool.php\" target=\"_blank\"]http://www.eaglesridge.com/with_pool.php[/a]

I am just trying to make a pet friendly page and the pet tag is already setup in the MYSQl. I just can't seem to get it to call/display in the pHP. Thanks
[/quote]

Im not all that experienced with this,..but if you post all the code for both pages I might be able to help you.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users