The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
INSERT TO MULTIPLE DB
#9
if(!empty($_POST['submit'])){
//Create an array of fields for your insert query
$fields = array(
'pr_nume_username' => Input::get('pr_nume_username'),
'pr_nume' => Input::get('pr_nume'),
'pr_telefon' => Input::get('pr_telefon') ,
'pr_animal_nume' => Input::get('pr_animal_nume'),
'pr_adaugat' => Input::get('pr_adaugat'),
'pr_data' => Input::get('pr_data'),
'pr_ora' => Input::get('pr_ora'),
'pr_kilograme' => Input::get('pr_kilograme'),
'pr_varsta' => Input::get('pr_varsta'),
'pr_sex' => Input::get('pr_sex'),
'pr_vacinat' => Input::get('pr_vacinat'),
'pr_detalii' => Input::get('pr_detalii')
);
$db->insert('propietar',$fields);
$newProId = $db->lastId();

// prepare sql and bind parameters
//Now they are being sanitized too!
//You really don't need to create a variable for each one unless
//you want to use it somewhere else on the page. You could just
//use Input::get down in the array below
$pro_id = Input::get('newProId');
$pro_nume = Input::get('pr_nume');
$pro_telefon = Input::get('pr_telefon');
$pro_animal_nume = Input::get('pr_animal_nume');
$pro_adaugat = Input::get('pr_adaugat');
$pro_data = Input::get('pr_data');
$pro_ora = Input::get('pr_ora');
$pro_vacinat = Input::get('pr_vacinat');
$pro_varsta = Input::get('pr_varsta');
$pro_kilograme = Input::get('pr_kilograme');
$pro_sex = Input::get('pr_sex');
$pro_alte_detalii = Input::get('pr_detalii');
$pro_pachet_mini = Input::get('pro_pachet_mini');
$pro_pachet_mediu = Input::get('pro_pachet_mediu');
$pro_pachet_maxi = Input::get('pro_pachet_maxi');
$pro_tuns = Input::get('pro_tuns');
$pro_spalat = Input::get('pro_spalat');
$pro_uscat = Input::get('pro_uscat');
$pro_taiat_ungi = Input::get('pro_taiat_ungi');
$pro_curatat_urechi = Input::get('pro_curatat_urechi');
$pro_vidat = Input::get('pro_vidat');
$pro_pernute = Input::get('pro_pernute');
$pro_periat = Input::get('pro_periat');
$pro_parfumat = Input::get('pro_parfumat');
$pro_fundita = Input::get('pro_fundita');
$pro_stele = Input::get('pro_stele');
$utilizatorr = Input::get('pr_nume_username');



>----------------THE PROBLEM IS HERE<-----------------

//Create an array of fields for your insert query
$fields2 = array(
'pro_id' => $newProId,
'pro_nume' => $pro_nume,
'pro_telefon' => $pro_telefon ,
'pro_animal_nume' => $pro_animal_nume,
'pro_adaugat' => $pro_adaugat,
'pro_data' => $pro_data,
'pro_ora' => $pro_ora,
'pro_vacinat' => $pro_vacinat,
'pro_varsta' => $pro_varsta,
'pro_kilograme' => $pro_kilograme,
'pro_sex' => $pro_sex,
'pro_alte_detalii' => $pro_alte_detalii,
'pro_pachet_mini' => $pro_pachet_mini, <-------------------
'pro_pachet_mediu' => $pro_pachet_mediu, <-------------------
'pro_pachet_maxi' => $pro_pachet_maxi, <-------------------
'pro_tuns' => $pro_tuns, <-------------------
'pro_spalat' => $pro_spalat, <-------------------
'pro_uscat' => $pro_uscat,<-------------------
'pro_taiat_ungi' => $pro_taiat_ungi,<-------------------
'pro_curatat_urechi' => $pro_curatat_urechi,<-------------------
'pro_vidat' => $pro_vidat,<-------------------
'pro_pernute' => $pro_pernute,<-------------------
'pro_periat' => $pro_periat,<-------------------
'pro_parfumat' => $pro_parfumat,<-------------------
'pro_fundita' => $pro_fundita,<-------------------
'pro_stele' => $pro_stele,
'id_key_sub' => $key,
'utilizatorr' => $utilizatorr
);
//Run the insert.
//to do an insert query, you only need to know what table and an array of fields. This creates, prepares, binds, and sanitizes your db update.

$db->insert('programare',$fields2);

//here is the id of the above query


//Put your sub queries down here...
header('Location: account.php');
}
  Reply


Messages In This Thread
INSERT TO MULTIPLE DB - by picassoo - 06-12-2017, 05:27 AM
INSERT TO MULTIPLE DB - by firestorm - 06-12-2017, 07:46 AM
INSERT TO MULTIPLE DB - by picassoo - 06-12-2017, 05:46 PM
INSERT TO MULTIPLE DB - by Brandin - 06-13-2017, 12:42 PM
INSERT TO MULTIPLE DB - by picassoo - 06-13-2017, 05:50 PM
INSERT TO MULTIPLE DB - by Brandin - 06-13-2017, 07:13 PM
INSERT TO MULTIPLE DB - by picassoo - 06-14-2017, 01:45 AM
INSERT TO MULTIPLE DB - by Brandin - 06-14-2017, 01:50 AM
INSERT TO MULTIPLE DB - by picassoo - 06-14-2017, 02:02 AM
INSERT TO MULTIPLE DB - by Brandin - 06-14-2017, 12:46 PM
INSERT TO MULTIPLE DB - by picassoo - 06-14-2017, 04:52 PM
INSERT TO MULTIPLE DB - by Brandin - 06-14-2017, 06:43 PM
INSERT TO MULTIPLE DB - by picassoo - 06-16-2017, 02:36 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)