मैं तैयार बयान का इस्तेमाल किया है एक आदेश तालिका में एक आदेश को सम्मिलित करने के लेकिन अब मैं आदेश आइटम पिछले आईडी आदेश तालिका में डाला के आधार पर तालिका में आदेश आइटम सम्मिलित करना चाहते हैं:mysql_insert_id() के बराबर क्या है; तैयार कथन का उपयोग कर?
if (isset($_POST['process'])) {
$order_name = $_POST['order_name'];
//create initial order
$stmt = $conn2->prepare("INSERT INTO orders (order_name) VALUES (?)");
$stmt->bind_param('s', $order_name);
$stmt->execute();
//this gets the most recent auto incremented ID from the database - this is the order_id we have just created
$order_id = mysql_insert_id();
//loop over all of our order items and add to the database
foreach ($_SESSION['order'] as $item) {
क्या बराबर है तैयार कथन का उपयोग कर mysql_insert_id();
पर?
क्या आपके सवाल है ? –
mysql_insert_id() क्या है; तैयार कथन शैली में? – user1227124
आपका मतलब है, पीडीओ लाइब्रेरी में 'mysql_insert_id' के बराबर क्या है? [दस्तावेज़ीकरण] के साथ कुछ गड़बड़ है (http://www.php.net/manual/en/pdo.lastinsertid.php)? –