how to select 主页报修上广告
$sql = "SELECT text,pic FROM newstable where type='在线报修上广告' order by id desc limit 0,1";
but you may find the return value is null
But i try to use this
$sql = "SELECT text,pic FROM newstable where type=N'在线报修上广告' order by id desc limit 0,1";
there is N before '在线报修上广告' ------->>>>>but it works....what's the meaning of this 'N'!!
What is the meaning of the prefix N in T-SQL statements?
It#s declaring your varchar as nvarchar which is using a unicode encoding page. Otherwise it will be converted to the default encoding page of your database. Basically it's prefered to use only varchar when intended (like email addresses)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With