Jump to content

Need help duplicating script


zachishi

Recommended Posts

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
Link to comment
Share on other sites

[!--quoteo(post=369276:date=Apr 27 2006, 12:38 PM:name=zachishi)--][div class=\'quotetop\']QUOTE(zachishi @ Apr 27 2006, 12:38 PM) [snapback]369276[/snapback][/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.
Link to comment
Share on other sites

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



Link to comment
Share on other sites

[!--quoteo(post=369613:date=Apr 28 2006, 11:11 AM:name=zachishi)--][div class=\'quotetop\']QUOTE(zachishi @ Apr 28 2006, 11:11 AM) [snapback]369613[/snapback][/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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.