Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Getting values from a MySQL database

$
0
0
Hey everyone,

I have a PHP/HTML file that connects to my MySQL database. The HTML part just makes the text area, but the PHP part does all the work. When a user enters a SQL command, it sends it to the database, and returns the value on the screen, just below the text area. It works great for checking and viewing data, such as SELECT * FROM blah and DESCRIBE blah, etc.

However, if the user wants to query the database, I have problems returning the result. Any SQL keywords such as WHERE, AND, GROUP BY, HAVING, ORDER BY, etc don't return anything. I can see that the query was successful because I have a PHP line that counts the rows affected, so I always see how many rows should be returned, but the data doesn't show up.

I think it would be a bit tedious to code in PHP what to do for every single possible SQL keyword. Is there some way I can just grab the returned table and put it on the screen?

Viewing all articles
Browse latest Browse all 51036

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>