This is my code
Expand|Select|Wrap|Line Numbers
- <?php
- //make conection
- $name=$_POST['name'];
- $cloth=$_POST['cloth'];
- $bag=$_POST['bag'];
- $connection = mysql_connect("localhost", "root","") or die("Could not connect to MYSQL");
- $selection=mysql_select_db("addname") or die ("Unable to select database");
- $sql="SELECT * from sum WHERE name like '$name'";
- $result= mysql_query($sql) or die(mysql_error());
- $record = mysql_num_rows($result);
- if ($record == 0)
- {
- $sql = "INSERT INTO sum( name, cloth, bag) VALUES ('$name', '$cloth', '$bag')";
- $result= mysql_query($sql);
- if ($result)
- { echo "Record added: $name $cloth $bag "; }
- else { die(mysql_error()); }
- }
- else
- echo "<br>record already exist";
- ?>
can some 1 help me about this problem,
i used to fix it by changing the name, but now. it not success any more.
thz.