PHP Traversing Result Set Why can t I get a value

Updated on society 2024-04-19
7 answers
  1. Anonymous users2024-02-08

    db->get_results('select * from '.tb_prefix.'product where categoryid=10');

    Is TB prefix a variable? There is no $ symbol.

  2. Anonymous users2024-02-07

    Manual query foreach a.

    queried out of the array.

    arr = array(

    array(id=>1,name=>'aa'),array(id=>2,name=>'bb'),array(id=>3,name=>'cc'),)foreach ($arr as $v)--name= ";}

  3. Anonymous users2024-02-06

    Assign a variable to query the result!

    Such as $sql ='select statement';

    query = mysql_query($sql);

    var_dump($query);

  4. Anonymous users2024-02-05

    Generally speaking, the data is read at the model layer, and then the logical operation is done in the service layer, and then the data is returned to the controller, and then the corresponding interface in the controller, this->assign('order',$ord);

    this->display();

    This is the MVC layer in TP, and you shouldn't have such a fine division here.

    So if you go this way, it's because you don't assign variables, you don't return.

    If you don't mind spending money, you can go to the actual TP on the MOOC to buy it, it should help you.

    Also, it is recommended to read the documentation and demo well.

  5. Anonymous users2024-02-04

    Traversing the store there should be.

    ord[$k]['storename']=m('store')->field('storename')->where("id=".$v['sid'])-find();

    or $result=m('store')->where("id=".$v['sid'])-find();

    ord[$k]['storename']=$result['storename'];

    That's it. direct ->field(); That's not right, right?

  6. Anonymous users2024-02-03

    Get all the data from the result set.

    function getall($sql)return $temp;Define an empty array to store the received data}else

    Get a piece of data.

    function getone($sql)else}

  7. Anonymous users2024-02-02

    PHP can pass values when traversing arrays, and if you want to change the value of the array, you can use subscripts or references.

Related questions
7 answers2024-04-19

First of all, the courseinfo method of the school class above is used to display information. >>>More

8 answers2024-04-19

Hey: Understood.

Stuck in it at the beginning. >>>More

4 answers2024-04-19

I like it, only when I'm together, I think about each other. Love, even if they are together, they miss him every second. Like a person, most of your friends, you will also feel happy. >>>More

22 answers2024-04-19

The data is stored in binary form in the computer, the decimal integer can be accurately converted to binary form, and there will be an error when the decimal number of the non-integer number is converted to a single-precision number or a double-precision number, and the non-integer number is used as a cyclic variable, and the step is also a non-integer number, so the number of cycles may not be as desirable. Therefore, you should avoid using non-integer numbers to control the loop. >>>More

15 answers2024-04-19

Grapes are the fruit that most people love to eat, but there will always be problems in the planting process that grapes do not bear fruit, why do grapes not bear fruit? What should I do if the grapes don't bear fruit? Let's take a look! >>>More