Petit problème PHP
otherwise01
-
Alain_42 Messages postés 5361 Date d'inscription Statut Membre Dernière intervention -
Alain_42 Messages postés 5361 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'ai un petit problème qui me prend pas mal la tête:
J'ai
$requete = "INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('1', '1', '1', '2009-04-05', '0000-00-00', '00:00:00', '00:00:00', 'xxxxx', 'ken', 'xxxx', '88.139.202.22', '1210521851', '<p>\r\nEdition 2009 xxx \r\n</p>\r\n<p>\r\n<a href=\"http://www.xxxx/\">https://www.xxx.com/ \r\n</p>\r\n', 'visu_xxxx.jpg', '0', '0000-00-00 00:00:00', '1', '1', '-1');
INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('2', '2', '2', '2008-06-15', '0000-00-00', '09:00:00', '00:00:00', 'Semi Canxxxo', 'madamegal', 'xxx@yahoo.fr', '62.147.184.222', '1210750925', 'http://www.xxx.com/<br />\r\n<br />\r\nY sera:<br />\r\nMadame Gxxxäl \r\n', '', '0', '0000-00-00 00:00:00', '1', '1', '-1');
INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('3', '1', '5', '2008-09-14', '0000-00-00', '00:00:00', '00:00:00', 'La Parisienne', 'Tati', 'xxxx', '82.123.174.186', '1210752026', '', '', '0', '0000-00-00 00:00:00', '1', '1', '-1');
INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('4', '3', '3', '2009-05-31', '0000-00-00', '00:00:00', '00:00:00', '20 kmsxxxes', 'Choupi', 'xxxx@hotmail.com', '158.169.131.14', '1210753045', 'Tour dxxxxous l\'arxxxndroit\r\n', '', '0', '0000-00-00 00:00:00', '1', '1', '-1');";
Je veux avoir au final:
$variable[0] = "('1', '1', '1', '2009-04-05', '0000-00-00', '00:00:00', '00:00:00', 'Marathon de Paris 2009', 'ken', 'xxx@yahoo.com', '88.139.202.22', '1210521851', '<p>\r\nEdition de Paris \r\n</p>\r\n<p>\r\n<a href=\"http://www.xxxcom/\">https://www.xxx.com/ \r\n</p>\r\n', 'visu_xxx.jpg', '0', '0000-00-00 00:00:00', '1', '1', '-1')";
$variable[1] = "('2', '2', '2', '2008-06-15', '0000-00-00', '09:00:00', '00:00:00', 'Semi Cancale - Saint Malo', 'madamegal', 'xxx@yahoo.fr', '62.147.184.222', '1210750925', 'http://www.xxx/<br />\r\n<br />\r\nY sera:<br />\r\nMadamexxx G&xxauml;l \r\n', '', '0', '0000-00-00 00:00:00', '1', '1', '-1')";
...
Je fais donc:
if (preg_match("!VALUES(.*);!Ui",$requete,$variable)) {
echo $variable[0];
echo $variable[1];
}
Mais j'obtiens:
$variable[0]= ('3', '1', '5', '2008-09-14', '0000-00-00', '00:00:00', '00:00:00', 'La Parisienne', 'Tati', 'xxxx', '82.123.174.186', '1210752026', '', '', '0', '0000-00-00 00:00:00', '1', '1', '-1')
et
$variable[1]= ('3', '1', '5', '2008-09-14', '0000-00-00', '00:00:00', '00:00:00', 'La Parisienne', 'Tati', 'xxxx', '82.123.174.186', '1210752026', '', '', '0', '0000-00-00 00:00:00', '1', '1', '-1')
Je ne comprends pas pourquoi...
J ai besoin d aide SVP !!
Merci beaucoup,
J'ai un petit problème qui me prend pas mal la tête:
J'ai
$requete = "INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('1', '1', '1', '2009-04-05', '0000-00-00', '00:00:00', '00:00:00', 'xxxxx', 'ken', 'xxxx', '88.139.202.22', '1210521851', '<p>\r\nEdition 2009 xxx \r\n</p>\r\n<p>\r\n<a href=\"http://www.xxxx/\">https://www.xxx.com/ \r\n</p>\r\n', 'visu_xxxx.jpg', '0', '0000-00-00 00:00:00', '1', '1', '-1');
INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('2', '2', '2', '2008-06-15', '0000-00-00', '09:00:00', '00:00:00', 'Semi Canxxxo', 'madamegal', 'xxx@yahoo.fr', '62.147.184.222', '1210750925', 'http://www.xxx.com/<br />\r\n<br />\r\nY sera:<br />\r\nMadame Gxxxäl \r\n', '', '0', '0000-00-00 00:00:00', '1', '1', '-1');
INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('3', '1', '5', '2008-09-14', '0000-00-00', '00:00:00', '00:00:00', 'La Parisienne', 'Tati', 'xxxx', '82.123.174.186', '1210752026', '', '', '0', '0000-00-00 00:00:00', '1', '1', '-1');
INSERT INTO `sss` (`id`, `locid`, `catsid`, `dates`, `enddates`, `times`, `endtimes`, `titel`, `alias`, `sendername`, `sendermail`, `deliverip`, `deliverdate`, `datdescription`, `datimage`, `checked_out`, `checked_out_time`, `registra`, `unregistra`, `published`) VALUES ('4', '3', '3', '2009-05-31', '0000-00-00', '00:00:00', '00:00:00', '20 kmsxxxes', 'Choupi', 'xxxx@hotmail.com', '158.169.131.14', '1210753045', 'Tour dxxxxous l\'arxxxndroit\r\n', '', '0', '0000-00-00 00:00:00', '1', '1', '-1');";
Je veux avoir au final:
$variable[0] = "('1', '1', '1', '2009-04-05', '0000-00-00', '00:00:00', '00:00:00', 'Marathon de Paris 2009', 'ken', 'xxx@yahoo.com', '88.139.202.22', '1210521851', '<p>\r\nEdition de Paris \r\n</p>\r\n<p>\r\n<a href=\"http://www.xxxcom/\">https://www.xxx.com/ \r\n</p>\r\n', 'visu_xxx.jpg', '0', '0000-00-00 00:00:00', '1', '1', '-1')";
$variable[1] = "('2', '2', '2', '2008-06-15', '0000-00-00', '09:00:00', '00:00:00', 'Semi Cancale - Saint Malo', 'madamegal', 'xxx@yahoo.fr', '62.147.184.222', '1210750925', 'http://www.xxx/<br />\r\n<br />\r\nY sera:<br />\r\nMadamexxx G&xxauml;l \r\n', '', '0', '0000-00-00 00:00:00', '1', '1', '-1')";
...
Je fais donc:
if (preg_match("!VALUES(.*);!Ui",$requete,$variable)) {
echo $variable[0];
echo $variable[1];
}
Mais j'obtiens:
$variable[0]= ('3', '1', '5', '2008-09-14', '0000-00-00', '00:00:00', '00:00:00', 'La Parisienne', 'Tati', 'xxxx', '82.123.174.186', '1210752026', '', '', '0', '0000-00-00 00:00:00', '1', '1', '-1')
et
$variable[1]= ('3', '1', '5', '2008-09-14', '0000-00-00', '00:00:00', '00:00:00', 'La Parisienne', 'Tati', 'xxxx', '82.123.174.186', '1210752026', '', '', '0', '0000-00-00 00:00:00', '1', '1', '-1')
Je ne comprends pas pourquoi...
J ai besoin d aide SVP !!
Merci beaucoup,
A voir également:
- Petit problème PHP
- Easy php - Télécharger - Divers Web & Internet
- Trier du plus petit au plus grand excel - Guide
- Petit 2 ✓ - Forum Windows
- Petit 3 ✓ - Forum Word
- Petit point vert snap ✓ - Forum Snapchat