mysql UNION | warning mysql_fetch_array !!


Posted on 16th Feb 2014 07:03 pm by admin

Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `division`='$f_usr_div' ORDER BY `pname` UNION SELECT `stock_close` FROM `stockiest_entry` WHERE `user_id`='$user_id' AND `stockiest_id`='$stckst_id' AND `month`='$f_month' AND `user_div`='$title_div' AND `fiscal_year`='$st_year'";
$result1=mysql_query($query1);
$i=0;
while($a_row=mysql_fetch_array($result1)) // line 89
{
global $i;
$i++;
$db_id=$a_row['id'];
$db_pname=$a_row['pname'];
$db_pcode=$a_row['pcode'];
$db_packing=$a_row['packing'];
$db_type=$a_row['ptype'];
$db_unit=$a_row['unit'];
$db_stock_close=$a_row['stock_close'];

print "$db_id, $db_pname, $db_pcode , $db_packing, $db_type, $db_unit, $db_stock_close";



i got error.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /domains/55373/web/ipharma/form_header_final.php on line 89

No comments posted yet

Your Answer:

Login to answer
129 Like 28 Dislike
Previous forums Next forums
Other forums

IP question
ive got 2 ip addresses both global from same user how would i detect if they are local to each other

need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working ca

this code is strange !
Hi i got this code from the web.. It checks for live and dead socks
It is working perfectly on my

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons

How to Create a Dynamic table
col1 col2 date1 date2 date3 date4..........
a b v1 v2 v3 v4

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder '

help with variable
I've got a problem, i want to echo some images depending on the $id, however for me to get that id i

Loop column after 2 results
Hello All.

Here is what I have:

Client ID Company name Clien

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash