Function functions in php will not be used.

Source: Internet
Author: User
Function functions in php are not used. on one of my one. php pages: & lt ;? Phpinclude (& quot; conn. php & quot;); $ rs = mysql_query (& quot; & nbsp; (& nbsp; selectop_valuesfrom function in php, will not be used?
On one of my one. php pages:
Include ("conn. php ");
$ Rs = mysql_query ("
(
Select op_values from table1 where op. id = 11
) Union
(
Select op_values from table2 where op. id = 12
)


While ($ row = mysql_fetch_array ($ rs ))
{
Echo "$ row [op_values]
";

}

?>


Under the two. php page:
Include ("conn. php ");

Define ('id _ OUTPUT_VOLTAGE ', 31 );
Define ('id _ OUTPUT_CURRENT ', 35 );

$ V = getProductAttributes (ID_V, $ p_id );
$ A = getProductAttributes (ID_A, $ p_id );

Function getProductAttributes (){
I won't write it here. I want to get the two SQL values op_values and echo them out.


}

Then w = V *;




------ Solution --------------------
PHP code
While ($ row = mysql_fetch_array ($ rs) {// echo "$ row [op_values]
"; // You do not need to output $ arr [] = $ row [op_values] if you only want to pass the value;}

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.