How can I modify the code to achieve the following results?

Source: Internet
Author: User
How to modify the code to reach the following results: lazygc520 and $ sql2 & nbsp ;=& nbsp; "SELECT & nbsp; stock_no, & nbsp; cust_no, & nbsp; m how to modify the code to achieve the following results
This post was last edited by lazygc520 at 12:00:23
$sql2 = "SELECT stock_no, cust_no, mount FROM `stock_detail` where stock_no = '".$stockno[$j-1]."' ORDER BY arr_time, adress, c_type ASC";
$result2 = mysql_query($sql2);
while($v2 = mysql_fetch_array($result2,MYSQL_ASSOC)) {
$v2[] = array_splice($a[$v2['stock_no']], 0, 13); 
$val_1 = implode(",",$v2['0']);
echo $val_1.' ';
}


The result is as follows:
VP3.0 130219001,VP3.0 130219002,VP3.0 130219003,VP3.0 130219004,VP3.0 130219005,VP3.0 130219006,VP3.0 130219007,VP3.0 130219008,VP3.0 130219009,VP3.0 130219010,VP3.0 130219011,VP3.0 130219012,VP3.0 130219013
 VP3.0 130219014,VP3.0 130219015,VP3.0 130219016,VP3.0 130219017,VP3.0 130219018,VP3.0 130219019,VP3.0 130219020,VP3.0 130219021,VP3.0 130219022,VP3.0 130219023,VP3.0 130219024,VP3.0 130219107,VP3.0 130219108
 


How to change:
'VP3.0 130219001','VP3.0 130219002','VP3.0 130219003','VP3.0 130219004','VP3.0 130219005','VP3.0 130219006','VP3.0 130219007','VP3.0 130219008','VP3.0 130219009','VP3.0 130219010','VP3.0 130219011','VP3.0 130219012','VP3.0 130219013'
 'VP3.0 130219014','VP3.0 130219015','VP3.0 130219016','VP3.0 130219017','VP3.0 130219018','VP3.0 130219019','VP3.0 130219020','VP3.0 130219021','VP3.0 130219022','VP3.0 130219023','VP3.0 130219024','VP3.0 130219107','VP3.0 130219108'
 

Share:
------ Solution --------------------
$val_1 = "'".implode("','",$v2['0'])."'"; 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.