MYSQL - Select specific value from a fetched array

后端 未结 9 1466
青春惊慌失措
青春惊慌失措 2021-01-06 01:45

I have a small problem and since I am very new to all this stuff, I was not successful on googling it, because I dont know the exact definitions for what I am looking for.

9条回答
  •  梦谈多话
    2021-01-06 02:35

    Yes, ideally you have to write another sql query to filter your results. If you had :

    SELECT * FROM Employes
    

    then you can filter it with :

    SELECT * FROM Employes WHERE Name="Paul";
    

    if you want every names that start with a P, you can achieve this with :

    SELECT * FROM Employes WHERE Name LIKE "P%";
    

    The main reason to use a sql query to filter your data is that the database manager systems like MySQL/MSSQL/Oracle/etc are highly optimized and they're way faster than a server-side condition block in PHP.

提交回复
热议问题