Search the Community
Showing results for tags 'result'.
-
I am having an issue where the output from a MySQL stored procedure is not handled correctly, when there is NO resultset, as opposed to a NULL resultset. For example: 1) select * from myTable; //this works, there are 0,1, multiple records returned 2) select * from myTable where 1=2; //this works, there are 0 records returned in a NULL resultset 3) set user_level = 'user'; if user_level = 'admin' then select * from myTable; //this never hits end if; There is an error in #3, the query is never touched, so NO resultset is returned. This is different from what happens in example #2, where a resultset is returned, it is just NULL. My code looks like this: if ( ($result = $mysqli_conn->query($SQL)) == false ) { printf("Invalid query: %s\nWhole query: %s\n", $mysqli_conn->error, $SQL); } else { while ($myrow = $result->fetch_array(MYSQLI_ASSOC)) { ... do something here } Any thoughts on how to handle this cleanly? Thanks all, Frank
-
i am trying to develop a registration form where the user fill the form and submit it then the status and the id should be displayed. i have used uniq_id function to generate a random id and with the help of this reference id i can retrieve the actual ID and display it back to the user. But unfortunately i am successful with the first registration after the first registration it throws an error that Error: "Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 9". my code: <?php include(conn.php); $id = $_GET['id']; $adv = $_GET['adv']; $name = $_GET['name']; $address = $_GET['address']; $pincode = $_GET['pincode']; $email = $_GET['email']; $fax = $_GET['fax']; $mobile = $_GET['mobile']; $amount = $_GET['amount']; $ddchno = $_GET['ddchno']; $bank = $_GET['bank']; $register = mysql_query( "insert into exbadv ( refid,adv,name,address,pincode,email,fax,mobile,amount,ddchno,bank) values ('$id','$adv','$name','$address','$pincode','$email','$fax','$mobile','$amount','$ddchno','$bank')"); $id = $_GET['id']; $result = mysql_query("SELECT id FROM exbadv WHERE refid = '$id'"); echo 'Your Registration id is ';echo mysql_result($result,0); ?> Plz help me out,thank u.
-
i am trying to develop a registration form where the user fill the form and submit it then the status and the id should be displayed. i have used uniq_id function to generate a random id and with the help of this reference id i can retrieve the actual ID and display it back to the user. But unfortunately i am successful with the first registration after the first registration it throws an error that Error: "Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 9". my code: <?php include(conn.php); $id = $_GET['id']; $adv = $_GET['adv']; $name = $_GET['name']; $address = $_GET['address']; $pincode = $_GET['pincode']; $email = $_GET['email']; $fax = $_GET['fax']; $mobile = $_GET['mobile']; $amount = $_GET['amount']; $ddchno = $_GET['ddchno']; $bank = $_GET['bank']; $register = mysql_query( "insert into exbadv ( refid,adv,name,address,pincode,email,fax,mobile,amount,ddchno,bank) values ('$id','$adv','$name','$address','$pincode','$email','$fax','$mobile','$amount','$ddchno','$bank')"); $id = $_GET['id']; $result = mysql_query("SELECT id FROM exbadv WHERE refid = '$id'"); echo 'Your Registration id is ';echo mysql_result($result,0); ?> Plz help me out,thank u.
-
Hi All, This code gives me the quantity output of the ordered products (per line): (int)($product['product_quantity']) Like: Product 1 - 5x Product 2 - 10x So, i want a function, that outputs the total of the order, like: Total products: 15x How can i store the code in an array and give the total order output? Thanks in advance! Bart