开发者

Find a string using PHPMyAdmin

开发者 https://www.devze.com 2023-04-05 23:00 出处:网络
i have table in DB = dle_post and a row contains id,full_story i want to check if full_story starts with \"1.\" then list its id but the big problem is there are some spaces in the start of full_story

i have table in DB = dle_post and a row contains id,full_story i want to check if full_story starts with "1." then list its id but the big problem is there are some spaces in the start of full_story some time 1 some time 2 and some ti开发者_运维百科me 3 , how can i list all ids starting with "1."


You want to execute some SQL like this, which you can also do in PHPmyAdmin...

SELECT id FROM dle_post WHERE LTRIM(full_story) LIKE '1%';

I think this will work!


Would this query help:

$id = fetch id here;
mysql_query("SELECT * FROM YOUR_TABLE WHERE id LIKE '%".$id."`%'", $someconnection);

YOUR_TABLE -> replace it with your table nime

0

精彩评论

暂无评论...
验证码 换一张
取 消