-
Posts
1,041 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
Post the actual error and line to which it refers.
-
That is not the code I suggested. In any case, that error appears to mean the database or network is down. It is coming from the connection code not the loop after the query.
-
Not quite. FetchAll will retrieve all the rows at once. If you want to use it then: $rows = $result2->fetchAll(PDO::FETCH_ASSOC) foreach ($rows as $key=>$value) { . . .
-
Try reading this.
-
You need to put the output in a loop. Fetch only gets 1 row. Your HTML only outputs 1 row. You need to move the fetch and loop on it where you start a new row. Also, don't use * in your select. List only those columns you will actually use. Since you don't use '$count' you don't need that statement.
-
You need to 'ORDER BY' in your query on state. Then keep a running total of 'UOMPVOLUMETOTAL' until the state changes or you reach the end or your data. At that point output your total and line break and reset the total to 0.
-
No, we need to see the actual output and how it plans to call the PHP script. However, it does look like JSON was the intention.
-
How do I change this Select Statement to $pdo->query
gw1500se replied to larry29936's topic in PHP Coding Help
Is 't.end' a string or number? Also, to me, it does not make sense to compare >= on IP addresses. IP addresses either are the same or are different. What are you really trying to do there? -
Did you check your maillog for errors? I suggest you use PHPMailer as it is much easier, gives you better control and is also easier to debug.
-
Language doesn't matter. What I want to see is the JSON output or whatever she programmed to be passed to the PHP script. It would be preferable if she programmed it to output it in JSON.
-
I think you need to start on the mobile side and, as gizmola suggested, create the json formatted data. Post a sample of that so we get a better idea of what it looks like and then we can help you go from there with the PHP side.
-
I assumed that they knew how to calculate the distance and just needed some pointers on how to structure the algorithm in PHP.
-
1 and 2 would presumably be input from the web page. The rest would be something like: for ($m=1; $m<=$M; $m++) { for ($l=1; $l<=$L; $l++) { for ($j=1; $j<=$N; $j++) { #do calculation here storing it in a 2D array } # select minimum here (perhaps min() function) } } # use array sort # use PHP vector class # compute distance from vectors # echo results in desired format
-
This is what you need.
-
Inserting rows with 'Checked' boxes into another table
gw1500se replied to PythonHelp's topic in PHP Coding Help
Use isset for checkboxes. -
Inserting rows with 'Checked' boxes into another table
gw1500se replied to PythonHelp's topic in PHP Coding Help
Show your HTML too. I am guessing your checkbox defintion is wrong. -
It doesn't matter. Strtotime includes the date.
-
The returned value of the checkbox will exist only if checked. You should use 'isset' to see it if was checked then take appropriate action if it was. You also left off the value parameter. You need both as I showed you.
-
You don't have your checkbox array specified correctly. Don't confuse the name with the value. <input type="checkbox" name="Part1[]" value="<?echo"$Part1[$count]"?>" >
-
You need to use strtotime. It will create a time stamp then you compare the time stamps directly. if(strtotime("+15 minutes") < strtotime($some_variable)) {
-
Pull Page Content's Styling onto Category Template
gw1500se replied to nvrsmr's topic in PHP Coding Help
That is not how you presented your OP and I'm sorry you took my meaning the wrong way. However, that does not mean you will succeed if you don't understand the basics. That being said you need to post your code here not make people go to a 3rd party site. If you don't even know what it means to echo variables how can you expect us to help? You need to post the problematic code here and its context along with any errors or what you are getting compared to what you expect. This forum has all the tools to post whatever you want to show. -
Search engines are your friend. This article is what you need.