Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

php mysql query extend to perform two actions

Posted on 2011-09-30
3
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

715 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