-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
How do I split a 'range' string into two lots?
ginerjm replied to simona6's topic in PHP Coding Help
Not too late. Modify the table but still use the literal description in your dropdown and then modify your query. POC! -
Have you done any reading on how classes work and how they act when first opened? When one makes a call such as "$myclass_hdl = new MYClass()" one does an "instantiation" of that class and assigns a handle that you continue to use to make further calls to that class and its methods and values. What happens with that "new" call is the construction of a class instance. Whatever you need to do to establish one occurrence (instance) of your class happens at this time. Reading the manual might improve your understanding.
-
How do I split a 'range' string into two lots?
ginerjm replied to simona6's topic in PHP Coding Help
One way might have been to use a different table design. Put the low and high values into it as separate columns, ie, 'low_value', 'high_value' and include the current string as a literal description of this range. Then do a query using a BETWEEN test against "low_value' and 'high_value' and choose whichever one you want to move forward with. -
And? It says that you don't have matching arguments and parameters. That means you have x number of defined parms in your query statement and y number of arguments (variables) bound to those. Fix that and try again. Could be the ssi string is short one character? AND upon a re-read of the message it is definitely the "ssi" string. The number of these parms must match the number of arguments you are supplying.
-
I personally can not see how I would ever write a block of code that looks like this!! What is that supposed to accomplish? Never mind - I don't want to know.
-
A clearer test could be to use the "isset" function: if (isset($_SESSION['message'])) echo $_SESSION['message'];
-
PHP was such a faculty? What does that mean? Am I hearing that you don't know how to program this using php at all and you are in a class to learn such?
-
Are you trying to learn the calculation (this is not a Math forum) or how to code it using PHP (this is a PHP forum)?
-
Do you think you could write your posts using some punctuation to make it easier to follow what you are saying? Proper sentences would help tremendously instead of a run-on stream of text with no easy way to make sense of what you are trying to say. A period here, a period there and some caps to start would be the thing to do.
-
Probably cause the selected value is named "max(id)" or something similar. Change the query to provide a name for the function result. select max(id) as maxid should do it and then you reference 'maxid' for your value.
-
Well the line of code I gave you does the trick.
-
select max(id)? You did that in your very first post, no? OR how about this: SELECT meet_date FROM `meeting_mins` WHERE 1 order by meet_date desc limit 2 This selects the 2 highest dates in my table.
-
Quick thought - Do you not store the check number with each row? Or is that the cleverly named 'id' column?
-
And you got rid of the errors because of that. That's how it supposed to be!
-
LINE 78 is a single line of code - not a block of code. You're wasting our time.
-
Why? You posted some code but you didn't say why. What? You just want me to go over it and verify that it is written correctly? I have no idea what it is trying to do so again I ask - Why? It looks silly to me. You have an array and you are putting different values into separate elements of it. What for? Are you going to implode those into a string later on?
-
Those are 'notices'. They are telling you that something is not correct. Show us one of those lines that have a notice. YOu have an undefined variable $line. Figure out why. Line 97 has a problem. You are using a non numeric value in some operation. Show us that line and echo out the var prior to hitting that line so you can see why you are getting that message. Those are quite obviously error messages. The line 9 error is because you are concatenating that string to a variable that has not been defined yet. Either declare it prior to that place or don't do a concat there.
-
Did you add the debugging before and during the loop process and not just the output step? How many rows are returned by the query? Echo out the key of each row processed in the loop. Echo out a completion message at the very end of the loop (assuming that the loop is where the output occurs). Any output that you can't tell if it is an error or not should be posted here. "Normal" behavior certainly doesn't look like an error! PS - did you add the error reporting lines I gave you?
-
You obviously don't know any php and furthermore are not willing to open up a book and look anything up. The trim function (mentioned above) is one that removes leading and trailing spaces from a string. That is all. It has nothing to do with a loop or with output. Why are you into something this deep if you don't know anything about php or programming? As a professional programmer I find it ridiculous when people with no knowledge think they can just jump into it and hope someone can hold their hand for the next 2 months teaching them what they should already have tried to learn for themselves. Have fun. It's a learning process that can possibly give you a new set of knowledge that you may find invaluable. But - it takes work. Good bye
-
So that sounds like a loop that is supposed to go thru all the products is failing you. Find that area and do some echos to show what it is finding and why it is stopping. Think!
-
And have you done any code to help you see what is going on inside? Do some echo statements to dump some of the values to see if they are what you think they are as you read thru your code. That is "debugging".
-
Don't know what you are telling me but you try by telling me what you found out from your debugging.
-
So add some echos to that script to show you what is happening or NOT happening.
-
What debugging attempts have you made so far? We're supposed to be looking at a lot of lines of your code without any idea what you have tried? Can you isolate where you think the problem lies?