Page 363 - CITS - CSA - TP (Volume 1) - Hindi
P. 363

कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS



                              $email = $_POST[“email”];
                              // Prepare and execute the SQL statement to insert data into the table

              $stmt = $conn->prepare(“INSERT INTO users (username, email) VALUES (?,?)”);
                              $stmt->bind_param(“ss”, $username, $email);

                                              if ($stmt->execute())
                                              {
                          echo “New record inserted successfully”;

                              }
                           else
                           {
                          echo “Error: “ . $conn->error;
                              }


                              // Close statement
                                              $stmt->close();
                                      }
                   // Close connection
                    $conn->close();

                            ?>
                        </body>
                 </html>
              3   ो ाम को C:\Apache24\htdocs म  insert.php नाम के  फ़ो र म  सेव कर

              4  अपाचे सिव स को िवंडोज़ सिव स से चलाएँ

              5   ाउज़र ओपन करे और िन  एड ेस टाइप कर
                 http://localhost/foldername/
              6  रन करने और आउटपुट वे रफाई करने के  िलए index.html फ़ाइल पर   क कर






























                                                           347

                                     CITS : IT & ITES - कं  ूटर सॉ वेयर ए ीके शन - अ ास 61
   358   359   360   361   362   363   364   365   366   367   368