0
RUN SQL QUERIES VIA PHP DATA OBJECT
Hi guys I am wondering how can I run SQL queries via a PHP file using POD ? I used conn->query(""); but it did not work is there any way to connect to a database and run queries directly to it using PHP ? beside mysqli
2 Antworten
+ 4
Make sure your connection looks like this
$db = new PDO("mysql:host=127.0.0.1;dbname=name", "root", "");
$query = $db->query("SELECT * FROM dbname")
while($row = $query->fetch()) {
}
https://www.w3schools.com/php/php_mysql_prepared_statements.asp
+ 1
my host is "localhost" but online do I have to change it into 127.... ?