jovankirimanyi jovankirimanyi
  • 24-03-2021
  • Computers and Technology
contestada

HOW DO I CONNECT TO MY mysql server on my computer locally using php and also how to run it on the browser

Respuesta :

tonb
tonb tonb
  • 24-03-2021

Answer:

<?php

$mysqli = new mysqli("127.0.0.1:3307", "myUser", "myPass", "databasename");

$query = "SELECT * FROM users ORDER BY name";

if($result = $mysqli->query($query))

{

   echo '<ul>';

while ($obj = $result->fetch_object())

   {

       echo '<li>'.$obj->name.'</li>';

   }

   $result->free();

   echo '</ul>';

}

else

{

   die("nothing found");

}

$mysqli->Close();

?>

Explanation:

This should get you started.

Answer Link

Otras preguntas

Why was the rana regime called the autocratic family rule?​
What is art in your own words please i need at least 1 paragraph not from the internet please
A solution of nitric acid is formed by dissolving 5.00grams of nitric acid in enough water to make 1.5 liters of solution. c. What was the molarity of this solu
If f(6)=7, find f−1(7)
Which culture did NOT influence flamenco? 1. Gypsy 2. German 3. Jewish 4. Moorish
Can someone please help me!! He shots out ice
use rounding to estimate 10 4/5 + 8 9/10 a. 20 b.19 c.18 d.19 1/2
starfish is radially symmetrical. Give reason​
So I have to create a timeline and research scientific advancements and the scientists who brought about the changes. It has to be a 10 point timeline from Aris
What is the value of the constant in the expression? 2x2 + 3x - y - 18 + 7y2