snhlawy Posted February 24, 2015 Share Posted February 24, 2015 i have the below error when trying to read arabic characters from DB to be displayed in the dropdown menu but if i read english characters from DB it works fine please help. the error message isSCREAM: Error suppression ignored for( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Autoservice website & system\inventory\pqty.php on line 132my code is<select name="owner"><?php mysql_connect("localhost","snhlawy","thena7labee") or die("Couldn't connect.");mysql_select_db("data") or die ("Couldn't select db.");$sql = mysql_query("SELECT desc FROM inventory");while ($row = mysql_fetch_array($sql)){?><option value="owner1"><?php echo $row['desc']; ?></option><?php// close while loop }?> Quote Link to comment https://forums.phpfreaks.com/topic/294848-dropdown-list-read-arabic-characters-from-mysql-db/ Share on other sites More sharing options...
CroNiX Posted February 24, 2015 Share Posted February 24, 2015 That means your query failed and you don't have a check for it. The first example in the php.net docs for mysql_query() show how to do that. However, pay attention to the big pink notice at the top of the page in the manual. The mysql extension is deprecated and won't be available in future versions of php, so if you want your app to work in the future without having to rewrite all of your DB stuff, you should use PDO or MySQLi (with an i) extension. Quote Link to comment https://forums.phpfreaks.com/topic/294848-dropdown-list-read-arabic-characters-from-mysql-db/#findComment-1506603 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.