Navigation

PHP

Export SQL database (all tables) in PHP to html

Export all tables to HTML:

SQL/PHP triky

 

xxx

$placeholders = array_fill(0, count($thingArray), '?');
$sql = "SELECT thing FROM things WHERE thing_uid IN (" . implode(',', $placeholders) . ")";
Tags: 

Facebook POST via PHP

APP access tokens are used to get information that your app is privileged to access. And in some cases where publish_stream is granted from an app user, you can use it to post to that user's wall, without needing a USER access token.

Example PHP SESSION_START

index.php

Upload souborů

<p>
<INPUT type="file" name="uploadedfile" size="62">

$trimmed=htmlspecialchars($_FILES["uploadedfile"]["name"]);
$trimmed=substr($trimmed, -3, 3);
$retez=$num_rows.".".$trimmed;

mysql_query("INSERT INTO quads (nazev,popis,cena,razeni,typ) VALUES ('$x_nazev','$x_popis','$x_cena','$x_razeni','$trimmed')");

$result=mysql_query("SELECT * FROM quads where nazev='$x_nazev' and popis='$x_popis'");
$cislo = @mysql_fetch_array($result);
//echo"$cislo[0]"; echo"<br>";
$uploaddir = './pictures/';
$uploadfile = $uploaddir . $cislo[0] . "." . $trimmed;

PHP - File upload

<p>
<INPUT type="file" name="uploadedfile" size="62">

$trimmed=htmlspecialchars($_FILES["uploadedfile"]["name"]);
$trimmed=substr($trimmed, -3, 3);
$retez=$num_rows.".".$trimmed;

mysql_query("INSERT INTO quads (nazev,popis,cena,razeni,typ) VALUES ('$x_nazev','$x_popis','$x_cena','$x_razeni','$trimmed')");

$result=mysql_query("SELECT * FROM quads where nazev='$x_nazev' and popis='$x_popis'");
$cislo = @mysql_fetch_array($result);
//echo"$cislo[0]"; echo"<br>";
$uploaddir = './pictures/';
$uploadfile = $uploaddir . $cislo[0] . "." . $trimmed;
Subscribe to PHP