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

x
?
Solved

problem with php script - truncate table

Posted on 2010-08-23
2
Medium Priority
?
264 Views
Last Modified: 2013-12-13
Greetings,

I have a php script that gets some data and inserts it into a mysql database.

Before it inserts the data it truncates the tables that it is going to insert into.  

that looks like this:

$query = "TRUNCATE TABLE features_tab";

$result = mysql_query($query);

Recently that part isn't working so when it runs it just adds to the database and it results in duplicates then triplicates and so on.

This coincides with moving the site to a new server.

So I am thinking about how to figure this out.  What is the best way to see what $result is in this example.

Thanks very much.

Sky
0
Comment
Question by:Schuyler Kuhl
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 33500543
$query = "TRUNCATE TABLE features_tab";
$result = mysql_query($query) or die (mysql_error());

and you should know what the error is you get.
0
 

Author Comment

by:Schuyler Kuhl
ID: 33500616
thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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