php - Two LIKE concate with Two Limits in sql -


i fetching data server this:

    $con = mysqli_connect($servername, $username, $password, $dbname);     $sql2 = "select * story  category concat('%' ,'worldlist', '%') order idstory desc limit 20";     $result2 = mysqli_query($conn, $sql2);     mysqli_query ($con,"set character_set_results='utf8'");     while($finalresult=mysqli_fetch_assoc($result2)){} 

now want data of category :

$conn = mysqli_connect($servername, $username, $password, $dbname);     $sql2 = "select * story  category concat('%' ,'worldlist', '%') order idstory desc limit 20 , concat('%' ,'worldtop', '%') order idstory desc limit 1,20";     $result2 = mysqli_query($conn, $sql2);     mysqli_query ($conn,"set character_set_results='utf8'");     while($finalresult=mysqli_fetch_assoc($result2)){} 

i know wrong not query how can make possible this.ps: new in php

use sql union

select * story  category concat('%' ,'worldlist', '%') limit 20  union select * story  category concat('%' ,'worldtop', '%') order idstory desc limit 20 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -