Hy Guys i always fail when i try to write with php to an other php file... It always delete me the $con and $result in the new file but why? Thanks in advance!
Tried to write with fwrite($newfile, $txt); fclose($newfile); into a php file but failed...
<?php
$con=mysqli_connect(\"localhost\",\"dbuser\",\"pw\",\"db\");
if (mysqli_connect_errno())
{
echo \"Failed to connect to MySQL: \" . mysqli_connect_error();
}
$result = mysqli_query($con,\"SELECT * FROM me where me_genre like '%$var7%' LIMIT 6\");
while($row = mysqli_fetch_array($result))
{
echo \"</div>\";
}
mysqli_close($con);
?>
$con and $result doesn't show up in new file...