- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am new to CSS-Triks!
Ok. now I explain the problem …
I have this little problem with PHP SQL I do not understand how to solve … I think the advancing age. :-/
$mysqli->query("INSERT INTO coming_soon_emails
SET email='".$mysqli->real_escape_string($_POST).", ".$mysqli->real_escape_string($_POST)."'");
The problem is that it adds “email” and “ip” in the same column “email” and the column “ip” is empty.
Regards, Mario
I found a solution, I still doubt whether this is the ideal solution.
$email = mysql_real_escape_string($_POST);
$mysqli->query("INSERT INTO coming_soon_emails (ip, email) VALUES ( '$ip', '$email')");
If you have an alternative, let me know. Tnx U very much
Mario
Mario,
Your first version of the query would have been wrong because of how you have it set up, but your second query looks just right. Anytime you need to insert, your final solution is the correct syntax.
Good work!
There is some rust in my Php Sql. (:
Ok, if I have more updates about it I make it known.
thanks