-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
But I've disabled user registration, it's for people who haven't or don't want to register.
-
[quote author=AndyB link=topic=110795.msg448545#msg448545 date=1160239395]
[quote author=mgallforever link=topic=110795.msg448540#msg448540 date=1160238896]
i'll show the whole code then :P
[code]
:)
[/code]
[/quote]
Thank you. I'll add you to my list of people who would like help.
[/quote]
What do you mean, haha, I only edited it. -
It doesnt post, it's for a theme, once a new user comes to the website they will automatically be inserted into the database w/ their IP and theme, sooner or later they can change this theme, but it's working now, thanks anyway!
-
Woah, thanks Orio, that works! Thanks alot!
-
i'll show the whole code then :P
[code]
:)
[/code] -
i'm not listing my database stuff :o
it doesnt want to insert a new row into the database
yes i did -
i'm not getting error messages, it just doesnt wanna sql
now it just echos the smiley -
[code]
<?php
$ip = $_SERVER[REMOTE_ADDR];
echo "<input type=hidden value='$ip'>";
$connection = mysql_connect(localhost,$dbuser,$dbpass;
$db = mysql_select_db($dbname, $connection);
$query="SELECT * FROM `theme` WHERE `ip`='$ip'";
$result44=mysql_query($query);
if(mysql_num_rows){
echo ":)";
}else
{
$query2 ="INSERT INTO `theme` (`ip` , `theme` ) VALUES ('$ip', '1');";
$sql1888 = mysql_query($query2);
};
?>
[/code]
it doesnt SQL the information -
[code]
$query = "INSERT INTO onlineform (name,Cname,email,query,Pnumber,date) VALUES ('$name','$Cname','$email','$Query', '$Pnumber', '$date')";
[/code]
try that -
is id primary key w/ auto_increment?
-
that would be great!
-
newb's post?
-
copy my code
-
hmm, it comes up with no errors for me, what error are you returning?
-
hmm, i can't recall the site name
-
this should be your final code
[code]
<?PHP
$Name=$_POST['name'];
$Cname=$_POST['cname'];
$Query=$_POST['Question'];
$email=$_POST['email'];
$Pnumber=$_POST['Pnumber'];
$date = time();
$showdate = date("F j, Y, g:i a");
mysql_select_db($database_csc, $csc);
$query_Recordset1 = "SELECT * FROM onlineform";
$Recordset1 = mysql_query($query_Recordset1, $csc) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$query_Recordset1 or die( "Unable to select database");
if($_POST['submit']) {
$query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$showdate')";
mysql_query($query);
mysql_close();
echo "<h2>THank you for filling in this form, we will be in touch with you ASAP</h2>";
echo $showdate;
}
?>[/code] -
he has:
$date = time();
and $showdate = date(); -
but i've seen places that havent gathered information and have posted my town and state
-
if you have a form do:
[code]
<input type=hidden value='<?php echo $showdate ?>'>
[/code] -
that's what he has.
did you change the $showdate to [code]$showdate = date("F j, Y, g:i a");[/code]
do that, then edit your sql
[code]
$query = "INSERT INTO onlineform VALUES ('$name','$Cname','$email','$Query', '$Pnumber', '$showdate')";
mysql_query($query);
[/code]
you had $date while $date = time();, showdate is the date -
well, how are you submitting it? because if i'm right your sql is incorrect
[code]
$query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$date')";
[/code]
should be:
[code]
$query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$showdate')";
[/code] -
[code]
$showdate = date("F j, Y, g:i a");
[/code]
It'll show like "October 5, 2006, 5:29 pm" -
...to echo the viewers Town/City and State on a page?
-
why would you use parenthesis when echoing something?
SQL Help needed
in PHP Coding Help
Posted