MySQL query working in phpmyadmin but not in php

后端 未结 2 1907
庸人自扰
庸人自扰 2021-01-21 03:44

I want to select data from a table in MySQL. My code in php:

$conn = mysqli_connect($db_server, $db_benutzer, $db_passwort, $db_name);

$results= mysqli_query($c         


        
2条回答
  •  萌比男神i
    2021-01-21 03:58

    1. You won't get 0 results in any way,you either get results or no results. 2.try removing the quotes from the table name
    2. Check for any Encoding issues with the connection encoding and that the data on the value of column russia is parsed as something else. Try executing the following query before executing your main query

      mysqli_query($conn,"SET character_set_results='utf8',character_set_client='utf8',character_set_connection='utf8',character_set_database='utf8',character_set_server='utf8'");

    The problems arise if there are Encoding issues in the connection.

提交回复
热议问题