zachishi Posted April 27, 2006 Share Posted April 27, 2006 Please view this code and tell me if there is a way to duplicate the center section that is in red. <?phpinclude_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 Link to comment Share on other sites More sharing options...
piznac Posted April 27, 2006 Share Posted April 27, 2006 [!--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. <?phpinclude_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. Quote Link to comment Share on other sites More sharing options...
zachishi Posted April 28, 2006 Author Share Posted April 28, 2006 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 Link to comment Share on other sites More sharing options...
piznac Posted May 1, 2006 Share Posted May 1, 2006 [!--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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.