-
Posts
1,041 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
This is probably a good place as any to start.
-
Leave it in benanamen's format in your database. Change the query result to whatever format you need when you do the compare.
-
Yep, now that I see the code properly posted with the formatter.
-
You are trying to convert the literal string ADDRESS. You need ADDRESS to be a variable, hopefully, in the form xxx.xxx.xxx.xxx.
-
Yep, the error is quite explicit. If you are having trouble seeing it echo $sql.
-
convert unsigned int ip_address from db to string
gw1500se replied to larry29936's topic in PHP Coding Help
inet_ntoa and inet_aton are MySQL functions. Use them in your queries. -
First please use the code icon (<>) and select PHP for your code. Second, where is that string coming from? It looks like the page is using GET not POST so you should me using $_GET. Third, never, ever put posted data directly into a query string. Use prepared statements only.
-
PHP uncaught error in script that runs fine in phpmyadmin
gw1500se replied to larry29936's topic in PHP Coding Help
OK, that is what I figured. You are not accessing the table you think you are. Post the code connecting to the database. -
PHP uncaught error in script that runs fine in phpmyadmin
gw1500se replied to larry29936's topic in PHP Coding Help
Impossible. I would expect the error to be on 'area'. -
PHP uncaught error in script that runs fine in phpmyadmin
gw1500se replied to larry29936's topic in PHP Coding Help
We've been here before. If you remove 'country' does it return the other values? -
I'm guessing when you changed to POST you did not change the array to $_POST which is why it didn't work.
-
Incorrect. The page waits for a response from the server in background.
- 6 replies
-
- notifications
- php
-
(and 1 more)
Tagged with:
-
Search engines are you friend. https://www.cloudways.com/blog/real-time-php-notification-system/
- 6 replies
-
- notifications
- php
-
(and 1 more)
Tagged with:
-
I guess you need to be more explicit. I was assuming the exception was thrown by the Json_decode. post the exact error message and indicate to which line it refers.
-
Did you var_dump the Json string before decoding it to make sure it is valid?
-
Insert data in html table or form from php sql retrieve
gw1500se replied to larry29936's topic in PHP Coding Help
Part of that problem may be the way you are storing it in you database. You should store it as unsigned int and use the MySQL functions INET_ATON and INET_NTOA in your queries. -
Insert data in html table or form from php sql retrieve
gw1500se replied to larry29936's topic in PHP Coding Help
That is a MySQL error being returned by PDO. Since you claim the echo'ed string works in a MySQL shell you need to do some testing. First try to run it without setting that column. Perhaps the error will move or it may go away. Depending on which, try setting just that column in a separate query. -
Insert data in html table or form from php sql retrieve
gw1500se replied to larry29936's topic in PHP Coding Help
Did you echo $sql1 then copy/paste that into the MySQL shell. -
Insert data in html table or form from php sql retrieve
gw1500se replied to larry29936's topic in PHP Coding Help
That is because there is a problem with your query. You may need take that problem to the MySQL forum but essential t2.country does not exist in that column. -
Insert data in html table or form from php sql retrieve
gw1500se replied to larry29936's topic in PHP Coding Help
Yes. $result is the data returned from the query where each element is a row from the query. The size of that array determines the size of your table. Although when you build the table you really don't need to know that. Jut add rows to the table until you run out of data. You can see what the array looks like with this: echo "<pre>"; print_r($result); echo "</pre>"; -
Insert data in html table or form from php sql retrieve
gw1500se replied to larry29936's topic in PHP Coding Help
This is a bit confusing but the first query seems unnecessary. You don't need a query just to find the count since later you query for the data. The last query does not want to be in a loop. After the execute do a fetch which gives you an array. The size of that array is the count for your table size. -
Inserting values to different tables based on variables
gw1500se replied to sfia's topic in PHP Coding Help
read this to see how to prepare and execute a query. -
Inserting values to different tables based on variables
gw1500se replied to sfia's topic in PHP Coding Help
I still don't understand this mysqli_query($sql1, $conn); mysqli_query($sql2, $conn); mysqli_query($sql3, $conn); when you haven't yet bound the variables. -
Inserting values to different tables based on variables
gw1500se replied to sfia's topic in PHP Coding Help
This code is confusing (please select PHP for your code next time). It appears you are running the query before you bind parameters. I don't seen how this can ever work. -
Help with improving web Form email validation, etc.
gw1500se replied to Chrisj's topic in PHP Coding Help
That is a link.