I have a problem with quotes. I can't use " or ' for $gname. What can I do for this.
$new_post = array( 'post_content' => ' ..CODES.. $result = mysqli_query($con,"SELECT * FROM wp_games WHERE name = $gname "); ..CODES..
I'm trying to create a post on wordpress.I have a plugin to use php on posts. [insert_php] is this plugin. And I also can't use quote like \" ... \" .Here is more code.
$new_post = array(
'post_content' => '[insert_php]$con=mysqli_connect("localhost","root","","wordpress");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM wp_games WHERE name = '$gname' ");
while($row = mysqli_fetch_assoc($result)) {
echo $row["name"];
}
mysqli_close($con);
[/insert_php]',