Jump to content

jonnypixel

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jonnypixel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thankyou, I used the the urlencode and it works now. Thanks for your help there.
  2. Hi, ( Thanks for any help in advance ) I am still learning php and if some one could help i would be very grateful, cheers. I have a menu system and it displays on my tabs correctly but when i hover over the Names with Two words ( eg: Brown Bread ) It only shows &cat=Brown ( In my URL ) $link = 'index.php?area=mypage&cat='; $html .= '<li><a href='.$link.''.$menuData['items'][$itemId]['name'].'>' .$menuData['items'][$itemId]['name']; // find childitems recursively $html .= buildMenu($itemId, $menuData); $html .= '</a></li>'; Can any one please help as to how i can keep the full two words showing in my link please? I want it to show &cat=Brown Bread ( In my URL ) I have tried variations of "\" "\" and '\' '\' But it either shows me an error or just adds it to the link URL.
  3. Hi, I'm only a noob. But your HTML Table is like static? You need to Create a Fetch Array - and limit the number of rows to 5 ( $rows = mysql_num_rows($result); ) You obviously need a correct qeury script based on variablesand field names from your table but below is how a Dynamic table is generated. <?php // Make a MySQL Connection // Get all the data from the "example" table $result = mysql_query("SELECT * FROM example") or die(mysql_error()); Somewhere here you would check the $rows count and display accordingly. echo "<table border='1'>"; echo "<tr> <th>Name</th> <th>Age</th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['name']; echo "</td><td>"; echo $row['age']; echo "</td></tr>"; } echo "</table>"; ?> I'm not sure you could hide the other tables because they are not dynamically made. They are hand coded. Hope that helps, Try googling TIZAG and start at the MYSQL tutorials. Good Luck
  4. Hi all, ( I have attached a Jpeg Screen grab for all those who are visual and couldn't be bothered reading my babble ) Just asking someone to please tell me why my code is not working. ( I have placed the code directly under my brief explanation ) I just want the Query to display the data on every menu item - ATM its only displaying data on the very last menu - and does this every time i add a new menu and submenu items to it. I have 3 fields that hold the structure inside a MYSQL row. cat_name : Accounts subcat1_name : Invoices subcat2_name : Vendors, Buyers, Templates. I have a menu i made with Jquery, which collects the data using 2 querys. One MYSQL QUERY displays subcat1_name based on the cat_name ( And this loops giving me horizontal tabs ) The Second MYSQL QUERY displays subcat2_name based on subcat1_name Name ( And so this loops and displays them in the slide down menu ) So... If I Rollover the Top Level Tabs , It seems that only the last Tab in the Menu works and the other ( which have sub menu items ) dont display. I think i have my loop query just getting the last entry's to the TABLE but dont know how to fix this. <ul class="menu" id="menu"> <?php $place= $_GET['place']; // This is just getting the table extension based on the page. $result = mysql_query("SELECT * FROM myTable_".$place." GROUP BY subcat1_name ORDER by id") or die(mysql_error()); while($row=mysql_fetch_assoc($result)) { $subcat1 = $row['subcat1_name']; ?> <li><a href="#"><?php echo $subcat1 ; ?></a> // Top level menu items <?php } ?> <ul> <?php $result = mysql_query("SELECT * FROM myTable_".$place." WHERE subcat1_name='$subcat1' GROUP BY subcat2_name ORDER by id") or die(mysql_error()); while($row=mysql_fetch_assoc($result)) { $subcat2 = $row['subcat2_name']; ?> <li><a href="#"><?php echo $subcat2 ; ?></a> // Submenu Level Menu items <?php } ?> </li> </ul> </li> </ul> [attachment deleted by admin]
  5. Hi there, I am having trouble trying to create a url with two ID numbers. I would like to POST to self and IF isset is delete then Delete listing_ID = 338 WHERE buyer_ID = 113 But i cant get the buyer_ID to add on to the end of my URL Heres my code, ( the page is called editBuyer.php ) <?php $buyersView = $_GET['manage']; This is the response to the link thats clicked further down this code. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(isset($_GET['delete'])) { $query1 = "DELETE FROM listingsmanager_buyersListings WHERE listing_ID = ".(int)$_GET['delete']." AND buyerID=".$buyersView; $result = mysql_query($query1) or die(mysql_error()); print "<h2>worked!</h2>"; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// print('<br><fieldset><legend>Listings Assigned</legend>'); $query4 = "SELECT listingsmanager_listing.listing_ID, listingsmanager_buyersListings.listing_ID FROM listingsmanager_listing RIGHT JOIN listingsmanager_buyersListings ON listingsmanager_listing.listing_ID = listingsmanager_buyersListings.listing_ID WHERE listingsmanager_buyersListings.buyers_ID =".$buyersView; $result = mysql_query($query4) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $listing_ID = $row['listing_ID']; $buyersView = $row['buyers_ID']; print ( "<div class='record'>REF." .$row['listing_ID'] . " This is the line thats causing me grief... ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <a href='".$page."&section=editBuyer&delete=".$row['listing_ID']."&buyerID=".$row['buyersView']."'>Un-Assign</a> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <a href='".$page."&section=viewListing&view=".$row['listing_ID']."'>Preview</a> </div> "); } print ('</fieldset>'); ?>
  6. Hi again, It seems there is more than one way to skin a cat... Thankyou to and I tried both methods and it seems that skinned the cat this time. Thankyou again to both of you champions for your willingness to help. John
  7. Sweet, Thankyou! I will try both your suggestions and most prob go for the 2 query solution. I am only new so i am trying AND but obviously it wont work if it cant be used in that context. oops! Thanks again, really appreciate that. John
  8. Hi, I am wanting to live search by either buyers ID or buyers name But when i try to add buyers name to the query it wont work. I have tried seperating filed names with a comma and also tried (field1,field2) But dosent seem to work. Im just trying to figure out how i can change this:: $query = "SELECT * FROM listingsmanager_buyers WHERE buyers_ID LIKE '$queryString%' LIMIT 10"; To something like this:: ( but actually one that works ) $query = "SELECT * FROM listingsmanager_buyers WHERE buyers_ID AND listingBuyers_name LIKE '$queryString%' LIMIT 10";
  9. Hi Matthew, Thankyou so much for your help. That worked!
  10. Hello, I am only new to php/mysql but loving it. Once again i have hit a hurtle when trying to figure out SELECT from 2 tables. I need to compare the listing_ID in my main listingsmanager_listing Table to the listing_ID in my listingsmanager_buyersListings Table. Then i want to show only the listings that the buyer_ID has attached to it from that listingsmanager_buyersListings Table. The reason i created the third table called buyerslistings is so that a listing can be removed from the buyer with out trashing the listing or the buyer in question. Any help with my code or the logic of how i am doing this would make me very very grateful. So below are my tables in question ( i have reduced the fields to show the example ) INSERT INTO `listingsmanager_buyers` (`buyers_ID`, `listingBuyers_name`, `listingBuyers_phone`) VALUES (52, 'Dave MacAuly', '54 879 079'), INSERT INTO `listingsmanager_buyersListings` (`id`, `buyers_ID`, `listing_ID`) VALUES (33, '52', '294'), (34, '52', '300'), INSERT INTO `listingsmanager_listing` (`listing_ID`, `listing_Title`) VALUES (294, 'McDonalds Net Lease Investments'), (296, 'Kentucky Fried Chicken'), (298, 'Pizza Hut'), (300, 'McDonalds Restaurant'); And below is my SELECT query $query2 = "SELECT listingsmanager_listing.listing_ID, listingsmanager_buyersListings.listing_ID ". "FROM listingsmanager_listing, listingsmanager_buyersListings". "WHERE listingsmanager_listing.listing_ID = listingsmanager_buyersListings.listing_ID". "AND listingsmanager_buyersListings.buyers_ID =".$buyers_ID; $result = mysql_query($query2); while ($row = mysql_fetch_array($result)) { $listing_ID = $row['listing_ID']; print ('<fieldset><legend>Listings Attached</legend>'); print('<b>Listing ID:</b> '.$listing_ID.'</fieldset>'); }
  11. Thankyou guys! I just came back here to find that you two cool people have given me some advice. Really appreciate that.
  12. Hi, im just a begginer... but wouldnt you echo the $SlideShow on a new page? probably wrap a div around it as well... i mean this as an example; <div> <?php echo $SlideShow ; ?> </div>
  13. Hi There, Im making a very basic realestate property listings script, I would like to create a listing and then attach leads to a listing. How would i go about removing a lead from a listing without deleting it? My field name that connects the 2 tables so far is just lead_listingID - but im wondering if i need to add something else? Im currently just showing the page by checking if a Listing has the same ID as the lead_listingID and then displaying that listing with the leads that are connected. I just dont know the logic i need to write on how to remove a lead from the listing without actually trashing the lead? I have the following tables so far: listing ( listingID, listingName, listingDesc ) lead ( leadID, lead_listingID, leadName, leadDesc ) The first field in both my listing table and my lead table are set to auto increment. If i havent provided enough info please let me know and i will post more of the data as i complete the forms that will post the values to the fields in a MYSQL database. Here is the php page code so far... <?php if ($servicecall != true) die('An error has occured. Please ensure you are logged in and try again.'); $urlListing = $_GET['listingURLidentifier']; $query = "SELECT * FROM listing WHERE listingID=".$urlListing; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $listingName = $row['listingName']; $listingDesc = $row['listingDesc']; print ('<h2>Listing details</h2>'); print('<b>Listing Name:</b> '.$listingName.'<br><br><b>Listing Description:</b> '.$listingDesc.''); } print('<br><br><br><br><br><br>'); $query = "SELECT * FROM lead WHERE lead_listingID=".$urlListing; $result = mysql_query($query); print ('<h2>Leads Attached to this listing</h2>'); if ( mysql_num_rows($result) > 0 ) { while ($row = mysql_fetch_array($result)) { $leadName = $row['leadName']; $leadDesc = $row['leadDesc']; print('<b>Lead Name:</b> '.$leadName.'<br><br><b>Lead Description:</b> '.$leadDesc.'<br>-------------------------------------------------------------------------------------------------------------------------<br>'); } } ?> Please help a begginer...
  14. Sorry for the delay, Incase you read this i just want to say a very big thankyou.
  15. Hello, I am very new to php and just have a question if its possible to pass values from one form thats hosted on my clients realestate cms site to a form that is hosted on a major realestate sites listing form. To say in a diffrenet way:: User on CMS Hosted realestate website creates new listing by filling out form THat new listing obviously goes into the MYSQL DB on the host But somewhere inthat process can that form data be passed to another form? The other form is in the login area of a major Realestate website agnts area where they can insert a listing I am basiaclly trying to find the easisest way to get property listings from clients Realestate CMS to the other major portals in realeste with out having them manually re-type the data. Is it possible to have the data remembered and then insertede? and if the values could some how be the same then just inserted them into the next form and so on? Note :: I have been reading that some realestates accept xml files - so if anyone could help with the way i could use php to pass to xml that would be graet. Any help / feedback would be much appreciated John
×
×
  • 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.