Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

php mysql query extend to perform two actions

Posted on 2011-09-30
3
Medium Priority
?
232 Views
Last Modified: 2012-05-12
I have the following snippet of php code.  I need to truncate two tables...how do I format the $query1 line to do this?

   
 $query1 = "TRUNCATE TABLE ALIASES";
    $result = mysql_query($query1);

    if ($result) 
       echo "ALIASES Table Reset
		 
	";
    else 
       echo "There was a problem resetting ALIASES
		 
	";

Open in new window

0
Comment
Question by:pda4me
3 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 36895220
Use two TRUNCATE queries.  Run them separately.  
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 36895291
I agree with Ray.
0
 

Author Closing Comment

by:pda4me
ID: 36895354
Thanks Ray!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question