Posts

Showing posts from December 26, 2018

inserting multiple data form checkbox into mysql

Image
-1 I have try for this code, but why the result is looping count for ex : choose 3 checkbox and will 9 data inserting into database and which 6 is double data..need help thank you for($count = 0; $count<count($_POST["checkbox_value"]); $count++) { foreach($_POST['checkbox_value'] as $check) { $values = explode('|', $check); $NameItem = $values[0]; $CodeItem = $values[1]; $ItemDesc = $values[2]; $ItemPrice = $values[3]; $query .= 'INSERT INTO item(item_name, item_code, item_description, item_price) VALUES("'.$NameItem.'", "'.$CodeItem.'", "'.$ItemDesc.'", "'.$ItemPrice.'"); ';} } m

Numbers such that they equal the product of their own digits

Image
6 For the sake of simplicity, I've been only looking in base $10$ numbers, though I've wondered how this might work in other bases - easier to stick with the familiar, though, since this is purely recreational. Analogous formulations hold in other bases, and are easily constructed (at least for bases $b$ which are integers greater than or equal to $2$ ). Insofar as context is concerned, there isn't much other than this was something I was thinking over last night, and I couldn't find any discussions about this online. Formulation of the Question: For argument's sake, let us consider our number to be $n$ , which can be represented by the following forms: $$n = ...d_3d_2d_1d_0.d_{-1}d_{-2}d_{-3}... Leftrightarrow n = sum_{k in mathbb{Z}} d_k 10^k$$ where each $d_k in {0, 1, ..., 9 }$ , with