Jump to content

Recommended Posts

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 is

SCREAM: 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 132

my 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 
}
?>

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.