06-02-2009, 12:58 PM
|
|
I am, who I am.
|
|
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 30,553
|
|
RE: Adopts News
Quote:
Originally Posted by Saphira
IDIDITIDIDITIDIDIT!
PHP Code:
// Find highest answer number.
$query = "SELECT MAX(nid) AS Max_nid FROM ".$prefix."news";
$result = mysql_query($query);
$Max_nid=@mysql_result($result,"Max_nid");
// add + 1 to highest answer number and keep it in variable name "$Max_id". if there no answer yet set it = 1
if ($result) {
$Max_idd = $Max_nid+1;
}
else {
$Max_idd = 1;
}
$topic = $_POST['topic'];
$topic = secure($topic);
$detail = $_POST['detail'];
$deatil = secure($detail);
$name = $_POST['name'];
$name = secure($name);
$datetime = date('d/m/y h:i:s');
$datetime = secure($datetime); //create date time
$topic = addslashes($topic);
$detail = addslashes($detail);
$query = "INSERT INTO ".$prefix."news(topic, detail, name, nid, datetime) VALUES('".$topic."', '".$detail."', '".$name."', '".$Max_idd."', '".$datetime."')";
$result = mysql_query($query);
I'm like, so happy right now. :P I was getting sick of writing "I'm testing using apostrophes." lol.
WHO'S THE MAN!
|
What did you do?
Quote:
Originally Posted by Saphira
I am male. Saphira is the name of my favourite fictional character of all time. She's the beautiful dragon from Eragon/Eldest/Brisingr. =P
|
o.0 Boy was I wrong.
|