0

i dont know why but sometimes i use the same exact thing ive used on other pages that it has worked for and it just doesnt work on the new page im working on.
i have a table called users. with columns called username password and status why isnt this working:

$var1 = "test1";
$var2 = "no app";
mysql_query("INSERT INTO users(`username`, `password`, `status`) VALUES('$var1', '$var2', '$var2')");

it also does not work if i take out the ` marks and when i add a $this = mysql....

Edited by SKANK!!!!!: n/a

2
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by SKANK!!!!!
0

i dont know why but sometimes i use the same exact thing ive used on other pages that it has worked for and it just doesnt work on the new page im working on.
i have a table called users. with columns called username password and status why isnt this working:

$var1 = "test1";
$var2 = "no app";
mysql_query("INSERT INTO users(`username`, `password`, `status`) VALUES('$var1', '$var2', '$var2')");

it also does not work if i take out the ` marks and when i add a $this = mysql....

try this

mysql_query("INSERT INTO users(`username`, `password`, `status`) VALUES('".$var1."', '".$var2."', '".$var2."')");
0

its still NOT WORKING. i dont know why ive used my previous code on every single thing basically that ive made so far. i just dont understand why it doesnt work sometimes....

0

its still NOT WORKING. i dont know why ive used my previous code on every single thing basically that ive made so far. i just dont understand why it doesnt work sometimes....

could u tell me the error message?

0

theres NO error message. i just keep checking the table everytime i go to the page and theres no row.. omgawd. i forgot to conect to the database. oppseis.
anyways thanks for helping. but i have another question. do u know how i can insert straight text into the database. instead of using variables cause just having like

VALUES('THETEXT', 'TEXTMORE'

doesnt work for me

0

theres NO error message. i just keep checking the table everytime i go to the page and theres no row.. omgawd. i forgot to conect to the database. oppseis.
anyways thanks for helping. but i have another question. do u know how i can insert straight text into the database. instead of using variables cause just having like

VALUES('THETEXT', 'TEXTMORE'

doesnt work for me

dont see any reason y u cant. but what so practical about it. or as Simon would say "wots the dream 'ere?" :D

0

dont see any reason y u cant. but what so practical about it. or as Simon would say "wots the dream 'ere?" :D

huh?

0

huh?

hehe, i meant that it shud work. and I asked y would u want to do that in the first place.

for example in ur case,

mysql_query("INSERT INTO users(`username`, `password`, `status`) VALUES('myusername', 'mypass', 'hehe')");

would work just fine.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.