PDA

View Full Version : PHP / mySQL here is what i want to do!


trancefuzion
1-20-04, 06:43 PM
Hi,

I am a new user on powweb forums. I try to fill my mySQL database with php script and nothing is working...! Can somebody help me?

I use this script to connect me at my database and write into it:

$liendb = mysql_connect("http://servername.powweb.com", "login", "password");
mysql_select_db("Database_name");

$sql = "INSERT INTO table_name (filed1, field2,field3) VALUES ('$field1','$field2','$field3')";
mysql_query ($sql);
mysql_close($liendb);


Thanks!
Trancefuzion

HalfaBee
1-20-04, 07:01 PM
Remove the http:// part of the severname.
You should put

mysql_connect( ... ) or die( mysql_error() );

so you can see what errors are occuring.

Pig
1-20-04, 07:01 PM
http://servername.powweb.com should not have http:// on it. Put in whatever is in OPS.

Also put in debugging so you know what goes wrong. mysql_connect(...) or die( mysql_error() );

Pig
1-20-04, 07:02 PM
LOL, Jinx.

HalfaBee
1-20-04, 07:03 PM
'Jinx' back to you. :D

trancefuzion
1-20-04, 07:37 PM
Thanks I will try it with the option to see mysql error. I already try without the http:// and nothing is working...

I' back in 10 minutes...

trancefuzion
1-20-04, 08:15 PM
Ok it works!

Thanks!