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

Linux, Apache, MySQL, PHP

 
GeneralRe: MySQL syntax error near '' Pin
Gerben Jongerius26-Oct-10 3:36
Gerben Jongerius26-Oct-10 3:36 
GeneralRe: MySQL syntax error near '' Pin
nathionice26-Oct-10 5:00
nathionice26-Oct-10 5:00 
GeneralRe: MySQL syntax error near '' Pin
Gerben Jongerius26-Oct-10 20:34
Gerben Jongerius26-Oct-10 20:34 
AnswerRe: MySQL syntax error near '' Pin
Graham Breach26-Oct-10 2:57
Graham Breach26-Oct-10 2:57 
AnswerRe: MySQL syntax error near '' Pin
cjoki26-Oct-10 5:04
cjoki26-Oct-10 5:04 
GeneralRe: MySQL syntax error near '' Pin
nathionice26-Oct-10 5:42
nathionice26-Oct-10 5:42 
GeneralRe: MySQL syntax error near '' Pin
Gerben Jongerius26-Oct-10 20:29
Gerben Jongerius26-Oct-10 20:29 
GeneralRe: MySQL syntax error near '' Pin
nathionice26-Oct-10 20:53
nathionice26-Oct-10 20:53 
I have changed the code to the following and decremented array count by 1 on $c = count($headerTable)-1; and it seems to work
Thanks a lot guys for helping
$query = "INSERT INTO ".$table."(FileIdentifier, Version, ReceiverIdentifier, Date, Time, FileGenerationNumber) VALUES";

    $c = count($headerTable)-1;
    echo "headerTable Count = ".$c;
     $numberOfLoops=0;
    for($i = 0; $i < $c; $i += 6)
    {
        // Add the next batch of values to the query string
        if($i==0)
        {
            $query.= "('".$headerTable[$i]."','".$headerTable[$i+1]."','".$headerTable[$i+2]."','".$headerTable[$i+3]."','".$headerTable[$i+4]."','".$headerTable[$i+5]."')";
        }
        else
        {
            $query.= ", ('".$headerTable[$i]."','".$headerTable[$i+1]."','".$headerTable[$i+2]."','".$headerTable[$i+3]."','".$headerTable[$i+4]."','".$headerTable[$i+5]."')";
        }
        echo $query;
        echo 'The number of loops';
        echo $numberOfLoops++;
        $result = mysql_query($query) or die('Query failed: ' . mysql_error());


    }
    return true;
    echo 'The number of loops';
    echo $numberOfLoops++;
}

GeneralRe: MySQL syntax error near '' Pin
cjoki27-Oct-10 5:50
cjoki27-Oct-10 5:50 
Questionhello about Cacti Pin
lxlenovostar19-Oct-10 2:38
lxlenovostar19-Oct-10 2:38 
AnswerRe: hello about Cacti Pin
cjoki19-Oct-10 4:39
cjoki19-Oct-10 4:39 
Questioni catch a problem when i compiling Pin
lxlenovostar18-Oct-10 3:03
lxlenovostar18-Oct-10 3:03 
AnswerRe: i catch a problem when i compiling Pin
Iranian MM8-Sep-11 5:30
Iranian MM8-Sep-11 5:30 
Questionproblem in windows 7 Pin
mstanwar13-Oct-10 14:46
mstanwar13-Oct-10 14:46 
AnswerRe: problem in windows 7 Pin
Mohamed7IBrahim18-Nov-10 3:48
Mohamed7IBrahim18-Nov-10 3:48 
GeneralRe: problem in windows 7 Pin
Ali Al Omairi(Abu AlHassan)13-Feb-11 14:50
professionalAli Al Omairi(Abu AlHassan)13-Feb-11 14:50 
QuestionPHP File Open and Reading character by character Pin
nathionice13-Oct-10 5:33
nathionice13-Oct-10 5:33 
AnswerRe: PHP File Open and Reading character by character Pin
cjoki14-Oct-10 4:44
cjoki14-Oct-10 4:44 
RantRe: PHP File Open and Reading character by character Pin
Macotti20-Oct-10 0:59
Macotti20-Oct-10 0:59 
GeneralRe: PHP File Open and Reading character by character Pin
cjoki20-Oct-10 5:00
cjoki20-Oct-10 5:00 
RantRe: PHP File Open and Reading character by character Pin
Macotti20-Oct-10 15:45
Macotti20-Oct-10 15:45 
GeneralRe: PHP File Open and Reading character by character Pin
cjoki21-Oct-10 7:38
cjoki21-Oct-10 7:38 
AnswerRe: PHP File Open and Reading character by character Pin
Macotti20-Oct-10 1:07
Macotti20-Oct-10 1:07 
AnswerRe: PHP File Open and Reading character by character Pin
solarpowerlightssource22-Oct-10 12:21
solarpowerlightssource22-Oct-10 12:21 
QuestionLogin and registration system using php Pin
Shamol-nahid11-Oct-10 14:24
Shamol-nahid11-Oct-10 14:24 

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.