Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql with php to add a row in table
    primarykey
    data
    text
    <p>I am super confused why this does not work, since it works on my other table. </p> <p>Here is procedure:</p> <pre><code>CREATE PROCEDURE dodaj_ubezpieczenie (do_nazwa_ubezpieczenia VARCHAR(30), do_wysokosc_ubezpieczenia decimal(4,2) ) MODIFIES SQL DATA BEGIN INSERT INTO ubezpieczenia (nazwa_ubezpieczenia,wysokosc_ubezpieczenia) VALUES (do_nazwa_ubezpieczenia,do_wysokosc_ubezpieczenia); END$$ </code></pre> <p>Procedure works with example:</p> <pre><code>call dodaj_ubezpieczenie('lol',5); </code></pre> <p>here is script:</p> <pre><code>&lt;?php error_reporting(E_ALL|E_NOTICE); $nazwabazydanych = "projekt"; $nazwa_ubezpieczenia = mysql_real_escape_string($_POST['nazwa_ubezpieczenia']); $wysokosc_ubezpieczenia = mysql_real_escape_string($_POST['wysokosc_ubezpieczenia']); if (!$nazwa_ubezpieczenia || !$wysokosc_ubezpieczenia) { print "Nie zostały wypełnione wszystkie pola"; exit; } $db = mysql_pconnect("localhost", "root", ""); if (!$db) { print "Nie można nawiązać połączenia z bazą danych"; exit; } mysql_select_db("$nazwabazydanych"); $query = mysql_query("CALL dodaj_ubezpieczenie ('$nazwa_ubezpieczenia','$wysokosc_ubezpieczenia')"); ?&gt; </code></pre> <p>The use of it:</p> <pre><code>&lt;form action="ubezp.php" method="post"&gt; Nazwa ubezpieczenia: &lt;input type="text" name="nazwa_ubezpieczenia" maxlength=30 size=31&gt;&lt;br&gt;&lt;br&gt; Wysokość ubezpieczenia: &lt;input type="text" name="wartosc_ubezpieczenia" maxlength=6 size=8&gt;&lt;br&gt;&lt;br&gt; &lt;input type="submit" value="Dodaj ubezpieczenie"&gt; &lt;/form&gt; </code></pre> <p>And finally the error:</p> <pre><code>Notice: Undefined index: wysokosc_ubezpieczenia in C:\xampp\htdocs\proj\ubezp.php on line 6 Nie zostały wypełnione wszystkie pola </code></pre> <p>I am really, really confused what is wrong here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload