-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Hopefully you have corrected that query sample you posted and that you have converted from using the deprecated MySQL_* functions from your script.
-
Can php do two execute (queries) in same time?
ginerjm replied to sigmahokies's topic in PHP Coding Help
I wouldn't call Barand's code OOP. It's the same code I use and I don't use OOP very often at all. So - it doesn't work. Care to enlighten us as to what error you are getting or what makes you feel it is not working? Maybe post your code so we can see what you are running. Be sure you have php error checking turned on too!! -
Can php do two execute (queries) in same time?
ginerjm replied to sigmahokies's topic in PHP Coding Help
I tried following you before, and just looked at this last post and still don't understand. How about giving us a real life example such as: Example 1: John Non1 John Non2 John Non3 ... ... ... jane local1 Jane local2 Jane local3 and show us how you want to see that output. What you gave us now gives you this: john non1 jane local1 jane local2 jane local3 john non2 john non3 My original interpretation of what you wanted was something like my Example 1: Non Locals: john non1 john non2 john non3 Locals: jane loc1 jane loc2 jane loc3 That is not what you want? -
Look at your script!! YOu blindly create php vars using stuff that may or may not exist. Then you output the email and send a success message. Where is you logic? Where do you even check if you have $_POST vars? You obviously are learning, but you also are obviously not used to programming in any language. YOu have to look at your code and know what it is doing and be sure that is what you want it to do. Start your script at the top by checking if a specific POST variable exists. I like to use the button value that the user clicks to submit the form. So if your submit button is named "btn" and the value of the button is 'Submit', then my first line would be : if (isset($_POST['btn']) && $_POST['btn'] == 'Submit') { continue with form processing and email build a success or failure message such as $msg = "???"; } else { handle the first time thru this script of some other submit button process (Cancel or Return??) } DisplayPage(); // call a function that displays all of my html code - the form and any messages. exit();
-
$_SESSIONS and $_FILES not working anymore on shared server
ginerjm replied to gerarddd's topic in PHP Coding Help
Show us your code that doesn't work -
Can php do two execute (queries) in same time?
ginerjm replied to sigmahokies's topic in PHP Coding Help
Why not just query all the members but order them by local or non-local and then make your table heading row as your go through the results in a loop and look for when you change from local to non-local data? -
What would be really nice is for the community/authors to FINALLY remove MySQL instead of having this long denouement. Of course it has come to fruition, but many, many users do not yet run the most current version. My hoster is currently only on 5.5
-
Without trying to follow your convoluted code, I wish to point out and ask one question. You start, quite properly I believe, by getting a list of the contents of your chosed directory. Then you start a loop on that array holding those names. But then you re-open the dir and start plucking filenames again which you already have available to you. Why? Seems to me you have what you need and should be simply attaching a handle to each and renaming it if it fits your conditions.
-
I think it is merely your path specification. Your glob argument is path/path/* . Do you have files named x or are they x.jpg, x.bmp, etc? Try path/path/*.*
-
You didn't escape the " at the end of the src= string. Try using single quotes so you don't have to escape the doubles. echo "<td width='100'><div align='center'><img src='http://www.brickbybricks.ca/php/images/" . $row['Color_Name'].$row['PartID'] . ".gif'></td>"; See how the entire string is in double quotes but the attributes inside of the tags are in single ones?
-
Barand gave you the exact code to use. Insert it into your existing code where it should be and see what it tells you.
-
Submiting form with text fields and checkbox's Need help
ginerjm replied to ericjw316's topic in PHP Coding Help
1 - you should not use a GET input directly without first checking that it is proper and not malicious. 2 - What you are showing me is that you are outputting a checkbox with a value that is equal to the very same checkbox that you must have already received. What is the point of this? -
Doesn't look like a php error, but then I haven't seen them all.
-
Is that a PHP error?
-
It definitely had to do with the quotes but the bind could have made for an additional problem. But - we'll never know....
-
benanamen - That is Exactly what I said all along. Remove the quotes around the query parms. What did you think I meant??
-
I still think it is because he bound the age as a string rather than an int. And the quotes on the query parms that I previously mentioned. We'll just have to wait and see what the OP responds with.
-
Don't wrap the query parms in the single quotes. Also when you use bindvalue (which I don't) the default type will be a string which you don't want for the age value. This works much better for me: $stmt->execute(array('name'=>$_POST['name'],'age'=>$_POST['age']));
-
beginning programmer error. Always check things. Never assume.
-
What is weird is that you have a record with no values in it other than the id. Why haven't you browsed your table (phpadmin?) to confirm that there is data in there?
-
Very puzzling. Please try this in your code: //fetch the results while(list($id,$name,$email,$phone) = $result->fetch_row()) { echo "id $id name $name email $email phone $phone<br>"; }
-
So your returned value is False. That implies that the execute failed. Never write code that "does" something that could fail without checking the result. Especially a class where you plan on using it a lot. So - test the execute and display the error (on screen during development or in your error_log once in production).
-
When you throw a bunch of class-related code at us and give us way too much to look at without fully understanding the goal, it makes us not want to help you. Try debugging each of your methods to be sure that they are doing EXACTLY what you expect. Once you are happy with them, do the same debugging with your surrounding logic to be sure that you are giving those methods what they expect and that the returns are what you expect still. When you get down to one single point of contention - show us that roadblock and tell us what is not working.
-
Your output seems to be exactly what you are echo-ing. If you want it formatted, do it with your echo or simply add another echo to output a line break. (inside the loop). As for missing items and the limit 1 points - show us that code if you want to discuss it.
-
Submiting form with text fields and checkbox's Need help
ginerjm replied to ericjw316's topic in PHP Coding Help
What do you mean "how to display" your checkbox on a get. The incoming query string will look like: checkboxname=checkboxvalue. Of course if you don't have an actual value= attribute on your checkbox tag (as I pointed out earlier), then 'checkboxvalue' may be non-existent in the string. A better checkbox tag: echo "<input type='checkbox' name='chkbox1' id='chkbox1' value='1'> <label for='chkbox1'>Selection 1</label>"; Here I assign a value of '1' to the choice of 'Selection 1'. You can just as well use 'Selection 1' in your value attribute, but that is up to the situation you are in.