Click here to Skip to main content
15,884,628 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: PHP Install Pin
cjoki6-Apr-10 6:12
cjoki6-Apr-10 6:12 
QuestionExporting to PDF using PHP code Pin
sarang_k29-Mar-10 18:23
sarang_k29-Mar-10 18:23 
AnswerRe: Exporting to PDF using PHP code Pin
Graham Breach30-Mar-10 0:05
Graham Breach30-Mar-10 0:05 
AnswerRe: Exporting to PDF using PHP code Pin
Luc Pattyn30-Mar-10 1:03
sitebuilderLuc Pattyn30-Mar-10 1:03 
QuestionMS Sql with php Pin
abd9028-Mar-10 2:36
abd9028-Mar-10 2:36 
AnswerRe: MS Sql with php Pin
chevu28-Mar-10 23:11
chevu28-Mar-10 23:11 
GeneralRe: MS Sql with php Pin
Jayapal Chandran5-Apr-10 7:21
Jayapal Chandran5-Apr-10 7:21 
Questionpreg_split & foreach loop - $_POST variables into an array, then into MySQL Pin
tasoptics28-Mar-10 2:27
tasoptics28-Mar-10 2:27 
I'm new to PHP and I'm trying to build a simple library interface...

For that I need a html form that has a text input for "keyword" and another for "author"

I am hoping to split (a) "keywords" by the regular expression ";", and (b) the "authors" by the regular expression ";", to separate one author from another and then by the regular expression "," to separate the array into two separate arrays - Surname and Firstname (for the MySQL Table Author). I will also want to include in each INSERT INTO query, another variable (from the same form), being the ID_Number of the book or article...

So, I am thinking if I used preg_split(";") for both (a) & (b) to give an array, say for table (a) Keyword

<?php
$keyword = preg_split(";",'$POST_[keywords]',-1,PREG_SPLIT_NO_EMPTY)
mysql="INSERT INTO Keyword (Keyword, ID_Number) Values
(FOREACH '$keyword', '$POST[ID_Number]')";


I'd dearly love some feedback, I'm trying to teach myself this on the fly Sigh | :sigh: If I can work out the first one (with only one split) then I can work on the nested array(s) and splitting the $author array into the same. The alternative is one ugly XHTML form, which I'd rather avoid.
AnswerRe: preg_split & foreach loop - $_POST variables into an array, then into MySQL Pin
chevu28-Mar-10 23:19
chevu28-Mar-10 23:19 
GeneralRe: preg_split & foreach loop - $_POST variables into an array, then into MySQL Pin
tasoptics29-Mar-10 2:44
tasoptics29-Mar-10 2:44 
Questiontime Pin
simpocoder26-Mar-10 2:45
simpocoder26-Mar-10 2:45 
AnswerRe: time Pin
Smithers-Jones26-Mar-10 2:49
Smithers-Jones26-Mar-10 2:49 
AnswerRe: time Pin
burntblark26-Mar-10 5:40
burntblark26-Mar-10 5:40 
GeneralRe: time Pin
simpocoder1-Apr-10 3:07
simpocoder1-Apr-10 3:07 
Questionconvert vb code to php Pin
kpuneeth726-Mar-10 2:41
kpuneeth726-Mar-10 2:41 
AnswerRe: convert vb code to php Pin
Smithers-Jones26-Mar-10 2:44
Smithers-Jones26-Mar-10 2:44 
GeneralRe: convert vb code to php Pin
kpuneeth726-Mar-10 3:00
kpuneeth726-Mar-10 3:00 
GeneralRe: convert vb code to php Pin
kpuneeth726-Mar-10 3:10
kpuneeth726-Mar-10 3:10 
QuestionPHP script for my project! Pin
peter43226-Mar-10 2:14
peter43226-Mar-10 2:14 
AnswerRe: PHP script for my project! Pin
Smithers-Jones26-Mar-10 2:42
Smithers-Jones26-Mar-10 2:42 
AnswerRe: PHP script for my project! Pin
Jayapal Chandran5-Apr-10 7:23
Jayapal Chandran5-Apr-10 7:23 
QuestionHow can i read or get an XML from another host? Pin
spawneditions24-Mar-10 9:09
spawneditions24-Mar-10 9:09 
AnswerRe: How can i read or get an XML from another host? Pin
cjoki1-Apr-10 9:21
cjoki1-Apr-10 9:21 
GeneralRe: How can i read or get an XML from another host? Pin
spawneditions5-Apr-10 9:14
spawneditions5-Apr-10 9:14 
AnswerRe: How can i read or get an XML from another host? Pin
Jayapal Chandran5-Apr-10 7:27
Jayapal Chandran5-Apr-10 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.