r/PHPhelp • u/youngjeeez • Nov 01 '17
Php code to call sql statements
Could someone help me with the pHp coffee to call SQL statements from a database
Thanks in advance
9
Upvotes
r/PHPhelp • u/youngjeeez • Nov 01 '17
Could someone help me with the pHp coffee to call SQL statements from a database
Thanks in advance
1
u/wh33t Nov 01 '17
$results in this case is not data, it's a result ID, you need to actually fetch the data out of the database.
If you want one row of data
If you want multiple
Also, you should be sanitizing that $_POST['search'] data so that you can't be easily SQL injected. If it's just a personal project running on your own machine I wouldn't worry about it, but if people from the raw internet will be hitting this thing you got some security work to do.