Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Which query in your code are you trying to add this to? You have two queries in your supplied code. If it is the first one, try this: SELECT tblLodges.strLodgeName, tblLodges.intLodgeNumber, tblLodges.strDistrictName, tblLodges.strLodgeWEB, tblLodges.strLodgeCounty, tblLodges.dtChartered, tblLodges.strLodgeAddress, tblLodges.strLodgeAddress2, tblLodges.strLodgeLocationCity, tblLodges.strLodgeLocationState, tblLodges.strLodgeLocationZip, tblLodges.strLodgeEmail, tblLodges.strLodgePhone, tblLodges.strLodgeFax, tblLodges.strDrivingDirectons, tblLodges.dtMeetingTime, tblLodges.dtMealTime, tblLodges.strFloorSchool, tblLodges.strLodgeNews, tblOfficers.strFirstName, tblOfficers.strLastName, tblLodgePics.link FROM tblLodges LEFT JOIN tblOfficers ON tblLodges.lngLodgeID = tblOfficers.lngLodgeID LEFT JOIN tblLodgePics ON tblLodgePics.lngLodgeID = tblLodges.lngLodgeID WHERE $metode LIKE '%$search%' GROUP BY tblLodges.strLodgeName LIMIT 0, 50 And of course to get the value for the image, you would just echo out $row['link']
  2. You can find everything you need to do this in the manual. Specifically on this page.
  3. Yes, although the variable $NOTCONNECTED will be linked somewhere else in the script, so I would check that out to see what it does.
  4. You could do something like this: <?php if ($conn = mysql_connect("....")){ //connection made } else { //need to redirect header("Location: www.sample.php"); } ?>
  5. Yes, that is the correct function to use in this case
  6. Awesome, I'm glad it worked You can insert HTML right in with the PHP, here is a snippet that may help you. Although I'm not exactly sure what your looking for. http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  7. Lets take one of your HTML options for example <option value="table1field1">table1field1</option> For the value of a table1 field, you are going to want to put this: value="t1.field_name" and just replace the "field_name" with whatever the fields name is. For a field in table2, you just want to put t2 instead of t1. I'm not positive this is going to work, but it's worth a shot. So do what I told you, and use the query I supplied in my last post. Just make sure you define the variable $metode and $search before using them in the query.
  8. First off, what does the variable $metode contain? I'm assuming it's a field name in the database, but from which table? Your query should look similar to this: SELECT t1.field1, t1.field2, t2.field1, t2.field2 FROM table1 t1 LEFT JOIN table2 t2 ON t1.ID_field = t2.ID_field WHERE $metode LIKE '%$search%' LIMIT 0, 50
  9. Shouldn't it be: $num = mysql_num_rows($aa); $row isn't even a query...
  10. I still don't see that line of code anywhere. Is it this line giving you the error? $num = mysql_num_rows($row); Where the heck is the $row variable defined?
  11. Change your header function to: header("Location: http://Sample.com/BlogInclude.php?blog=$blog&Referrer=$Referrer");
  12. I don't see the line of code in your original post anywhere in the code you just posted. Can you just post the relevant part?
  13. There is probably something wrong with your query, post more code.
  14. It only returns one row, correct? You can replace the '*' with whatever columns you need. I'm not sure if thats what you were talking about though.
  15. Here is an example of selecting one random row SELECT * FROM table ORDER BY RAND() LIMIT 1
  16. The old host probably had register_globals on, and your new host has them off. So your going to have to go through the script and actually define the variables that didn't have to be when register_globals was on.
  17. Exactly, it takes 100,000 iterations for that small change in time. That would be one large program, but yes, if you are making a program that big then using single quotes wouldn't be a bad idea. Otherwise if you have a relatively small script it really isn't a big deal.
  18. The @ symbol can be used to suppress errors from showing, which usually isn't the best thing to do. In the code you posted it doesn't really look like thats how it's being used, I'm not aware of any other use for it.
  19. Just practice Don't forget to press solved.
  20. Your form action should look like this: <form action="test.php?id=<?php echo $_GET['id']; ?>" method="post">
  21. Well, what does your form action look like? Where it says "same as page". if your url looks like this: test.php?id=17 WHILE the form is displaying and the form action isn't set to keep the id in the URL, then no...it isn't going to work. When you click submit it's just going to clear all the GET information from the URL unless you have it set to stay.
  22. Once the submit button is pressed, the URL isn't going to stick, unless you put it in the form action to do so. You can put the id in a hidden input and carry it over to the next page as Ken did in his example.
  23. You shouldn't have to use global to use the variable $id inside the IF statement. <?php //this works fine... $id = $_GET["id"]; //but this doesn't... $id = $_GET["id"]; ...They both look identical to me. Are you positive "id" is set in the URL? Copy and paste your URL AFTER you submit the form.
  24. You need to look into AJAX for this. I personally can't help you as I don't have a ton of experience using AJAX.
×
×
  • 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.