CharlesCraft50 Posted March 20, 2016 Posted March 20, 2016 I got an Error in my Code that:0 results: : Table 'ccraft50_db.MyGuests_Index' doesn't exist This is my code: <?php $servername = "localhost"; $username = "ccraft50_db"; $password = "my password"; $dbname = "ccraft50_db"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, firstname, lastname FROM MyGuests"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "0 results: " . $conn->error; } $conn->close(); ?> How do I remove the database name in my Table? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.