sequential execution of mysql queries within a php script

hi again :smiley:
here comes a brand new question for you!!

i have a mysql database with two tables. the tables are empty and i have

-a mysql query to load data to the tables
-a mysql query to clear a table
-a mysql query to select some objects from the tables.

all i want is to write a script that : clears the tables, then loads data to them and then selects some object3. in other words i want to execute 5 queries sequentially in the same script. can i do that?

do i have just to set a new connection before each query?

looking forward to receiving your answer :slight_smile:

simple answer: Yes.

All you do is connect to the database before running any queries then run your quires in the oder you want them to run in.

Its known as procedural programming.

For instance:

[php]<?php

//connect to DB

//run query1

//run query2

//run query3

//run query4

?>[/php]

thanks a lot dear helper :slight_smile:

more questions are about to come :stuck_out_tongue:

Sponsor our Newsletter | Privacy Policy | Terms of Service