Re: Error Msg: Wrong data type when performing "extract()"

From: Date: Thu, 19 Apr 2001 03:10:21 +0000
Subject: Re: Error Msg: Wrong data type when performing "extract()"
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-8685@lists.php.net to get a copy of this message
Shahimat, What did you change? Should equip_id and vendor_id be $equip_id and $vendor_id repectively? If you run the SQL at the database console, what results are returned? Have you checked the value returned by mysql_num_rows( $result )? Have you tested to see if you have values in $row[ equip_type ], $row[ timestamp ], etc.? I'd suspect your query, as the call to extract() is pretty straightforward. I've had $result assigned a value when no rows were returned. Miles At 10:40 AM 4/19/01 +0800, Shahmat Dahlan wrote:
$sqlstmt ="SELECT stock_in.id, equip.equip_type, "; $sqlstmt.="equip.brand, equip.model, "; $sqlstmt.="vendor.name, stock_in.po_no, "; $sqlstmt.="stock_in.vendor_sales_no, stock_in.cust_po_no, "; $sqlstmt.="stock_in.serial, stock_in.warranty, stock_in.date_received, "; $sqlstmt.="stock_in.remark, stock_in.timestamp "; $sqlstmt.="FROM stock_in, equip, vendor "; $sqlstmt.="WHERE equip.id=equip_id and vendor.id=vendor_id and equip.id='$id' "; $sqlstmt.="ORDER BY equip.id ASC"; # print $sqlstmt; $result=mysql_query($sqlstmt); # print $result; $row=mysql_fetch_array($result) extract($row); If I do the above, I get the results below: Warning: Wrong datatype in call to extract() in E:\winnt\temp\stock_in.php on line 39 I've went through the query, and it seems alright. It worked previously, now all of a sudden it doesn't work anymore.. Can anyone help me out. Thanks in advance. Shahmat


« previous php.db (#8685) next »