Page 1 of 1

mysql query pro in php

Posted: Mon Jul 28, 2008 7:37 am
by ganesh
1 i written code for mysql query,its working fine,but its adding same data again and again when the use refresh page. means its making duplicate records how toavoid this prob..

2 hi friends...i need yahoo mail table effect. there we can control coloumn width, is it possible? how & wht is the code?

Re: mysql query pro in php

Posted: Mon Jul 28, 2008 7:18 pm
by andychamberlainuk
There are a few ways I can think...

1) Why not run a query before the insert query to check if the data already exist. A common example is with user registration. To ensure that you don't duplicate a username, you must first search the table for that username.

2) You could redirect to a confirmation page after your update

e.g. header("Location:http://mysitename.com/confirm.php");

Hope this helps!