I am a PHP cainiao. I am stuck with this problem. If I want to select a package, I will insert the menu bar directly and the SQL statement will be stuck .. I don't know why I wrote Table A: bigtype [2] Table B: smalltype [3] {code ...}
I am a PHP cainiao. I am stuck with this problem. If I want to select a package, I will insert the menu bar directly and the SQL statement will be stuck .. I don't know why.
Table A: bigtype [2] Table B: smalltype [3]
If (isset ($ _ POST ['submit ']) {$ cd =$ _ POST ['bigtype']; $ query = "insert into smalltype... Please help me ····"}
Reply content:
I am a PHP cainiao. I am stuck with this problem. If I want to select a package, I will insert the menu bar directly and the SQL statement will be stuck .. I don't know why.
Table A: bigtype [2] Table B: smalltype [3]
If (isset ($ _ POST ['submit ']) {$ cd =$ _ POST ['bigtype']; $ query = "insert into smalltype... Please help me ····"}
$ Query = "INSERTsmalltype
(bid
,smalltype
) VALUES ('". mysql_real_escape_string ($ bid)."', '". mysql_real_escape_string ($ smalltype )."')";
Are two tables associated with IDs?
If yes, assume that the first table is A and the last table is B.
Select A. * from A, B where A. id = B. id and B. bigtype = 'variable parameter ';
php
if(isset($_POST['submit'])){ $big_type = $_POST['bigtype']; $small_type = $_POST['small_type']; $query="INSERT INTO smalltype (bid, smalltype)VALUES(".quote($big_type).",".DB::quote($small_type).")"; DB::query($query);}
I don't understand what I want to do ......
Do not add redundant information to the database. If bigtype and small are divided into two tables, you do not need to copy bigtype again and put it in smalltype. You should connect it with union in SELECT.
It should be based on $ cd =$ _ POST ['bigtype'], select table B to get BID, and then insert Table A (BID, smalltype)
This should be the background that returns all the data in JSON format. It is more appropriate to use the front-end JS control.