insert into mysql a list of values

what if i have an else if statements, how will i insert entries in an array?
below in the example in a comment line i inserted some of my questions…

for example,
[php]
$token = strtok($webpagedata, " .,;:\n");

while ($token != false) {

while($token != '//'){
if($token == 'ID')
{

$token1 = $token = strtok(" .,;:\n");
echo "Entry name =$token1<br />";
       
//insert $token1 into a column 'entry' in db
}

else if($token == 'OC')
{

$token1 = $token = strtok(" .,;:\n");
 if($token1 == 'Eukaryota') 
    { 
        
echo "FEATURE =$token1<br />";

//insert $token1 into a column ‘feature’ in db
}
}
else
{
//
}
$token1 = $token = strtok(" .,;:\n");

}

}
//then after reading and if it sees a comment line ‘//’ it will loop again and insert again entries to another set of query
[/php]

Not sure what you are asking, but, going from the title, I am assuming you are asking for help inserting data into a database.

To do this you would just use a standard SQL QUERY. Something like…
$query=“INSERT into TableName (FieldName1, FieldName2, FieldName3, etc) VALUES ($token1, $token2, Token3, etc…)”;

then, just do an execute of the query to the database…

Not sure if that is what you are asking… Good luck…

Sponsor our Newsletter | Privacy Policy | Terms of Service