Topic: Php Help

I want to do something like this...

If you goto a something like this for example … ass=gdhdgh

then it would add newera70 and gdhdgh into a database...

i tried it with this code...

$dbhost = "localhost";
$dbuser = "thrice_test";
$dbpass = "test";
$dbname = "thrice_test";


  $User = $_GET['user'];
  $Pass = $_GET['pass'];
    if($User != "" && $Pass != "")
                mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_query("INSERT INTO pkbot WHERE user = '$User' AND pass = '$Pass'");
    else if($User == "" && $Pass == "")

someone please help....

- Newera70

Re: Php Help

You made a comment outside of the PHP tags wink
Your insert query structure is wrong
should be

insert into [table] ([column], [column]) values ([value], [value])

Free PunBB Hosting - lots of mods, easy to customize

Re: Php Help

those comments were just for posting this... what would i put for the insert into then can u find out by looking at my code?

Re: Php Help

mysql_query("INSERT INTO pkbot SET user = '$User' AND pass = '$Pass'");
// or
mysql_query("INSERT INTO pkbot (user, pass) VALUES( user = '$User' AND pass = '$Pass')");
// or maybe you meant
$query = mysql_query("SELECT * FROM pkbot WHERE user='$User' AND pass='$Pass'");
$theQuestion = (2*b) || !(2*b);