pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
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']
-
You can find everything you need to do this in the manual. Specifically on this page.
-
How to retrieve the last auto-incremented ID?
pocobueno1388 replied to ivytony's topic in MySQL Help
Yes, that is the correct function to use in this case -
Searching Multiple Tables AND $metode Like'%$search%
pocobueno1388 replied to JTapp's topic in PHP Coding Help
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 -
Searching Multiple Tables AND $metode Like'%$search%
pocobueno1388 replied to JTapp's topic in PHP Coding Help
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. -
Searching Multiple Tables AND $metode Like'%$search%
pocobueno1388 replied to JTapp's topic in PHP Coding Help
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 -
Don't forget to press solved
-
Shouldn't it be: $num = mysql_num_rows($aa); $row isn't even a query...
-
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?
-
Change your header function to: header("Location: http://Sample.com/BlogInclude.php?blog=$blog&Referrer=$Referrer");
-
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?
-
There is probably something wrong with your query, post more code.
-
best way to select random row of database of 100k+ in size
pocobueno1388 replied to krispykreme's topic in MySQL Help
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. -
best way to select random row of database of 100k+ in size
pocobueno1388 replied to krispykreme's topic in MySQL Help
Here is an example of selecting one random row SELECT * FROM table ORDER BY RAND() LIMIT 1 -
Change of Hosting, application no longer works
pocobueno1388 replied to TecTao's topic in PHP Coding Help
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. -
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.
-
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.
-
Just practice Don't forget to press solved.
-
Your form action should look like this: <form action="test.php?id=<?php echo $_GET['id']; ?>" method="post">
-
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.
-
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.
-
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.
-
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.