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

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Fatal error: Call to a member function fetchrow() on a non-object in C:xamppht
okay i have this query and everytime i add `item_id`=? to it... it gives me the error in the title..

cURL Upload Help
OK, I am creating a bridge from a local program to my website and I am trying to find the best way t

HTML Form Server Side Validation
Hi, Im new here, im currently doing a website for a friend, and I have designed using snippets from

Scene graph using Direct3D?
There are several C++ scene graph based packages available for OpenGl, like say OSG,

http://w

pop3 and fsockopen
So I am able to connect to the pop3 server, log in, and check how many messages there are. I am hav

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

drop-down with sub-category appear
Hello,

i know how to build a simple dro-down list, im looking for a code when im gonna choose

Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters

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