Witam tworze sobie system newsów we flashu wysyłam dane z flasha i po przez php łącze się z bazą (IMG:
http://forum.php.pl/style_emoticons/default/smile.gif) Wszystko działa poprawnie newsy są wyświetlane są zapisywane w bazie ... Problem polega na tym ,że gdy wyświetlam te newsy to za kazdym razem jak je wyswietle tworzy sie pusty wpsi w bazie danych jest podane tylko id nadane przez pole int(11) z auto_increment pozostałe pola to varchar(255) sa puste (Tak samo z siebie sie to nie dzieje (IMG:
http://forum.php.pl/style_emoticons/default/tongue.gif) )
kod PHP:
<?
/* MySQL details */
$dbHost = "sql.baza.pl";
$dbUser = "user";
$dbPass = "pass";
$dbName = "baza";
$table = "downloadLog";
/* Attempt connection to MySQL server */
/* If connection wasn't successful... */
if (!$link) {
/* Return error information to Flash and quit! */
print "&news=" . urlencode("<b>Error:</b> Could not conenct to database") . "&"; }
/* Attempt to select our database */
/* If not able to select... */
/* Return error information to Flash and quit! */
print "&news=" . urlencode("<b>Error:</b> Could not find $dbName database") . "&"; }
/* Fetch current time from server */
/* Build SQL query to insert our information into table */
$query = "INSERT INTO $table (tresc, nadawca, entryDate) ";
$query .= "VALUES('$tresc', '$nadawca', $currentTime)";
/* Execute query */
/* If there was an error executing query... */
if (!$result) {
/* Return error information to Flash and quit! */
print "&news=" . urlencode("Error: Could not insert record into download log") . "&"; }
/* Build SQL query to fetch all entries from the table */
$query = "SELECT * FROM $table ORDER BY entryDate DESC";
/* Execute query */
/* If there was a problem with the query... */
/* Return error information to Flash and quit! */
}
/* Reset variable to hold output */
$news = "";
/* For each table entry returned... */
/* Create human readable date from timestamp */
$entryDate = strftime("%A %d/%m/%y", $row['entryDate']);
/* Add details to output variable */
$news .= "<p class='style1'><b>Data:</b> " . $entryDate . "<br></p>";
$news .= "<p class='style2'><b>Nadawca:</b> " . $row['nadawca'] . "<br></p>";
$news .= "<p class='style3'><b>Tresc:</b> " . $row['tresc'] . "<br></p>";
}
/* Output data in required format */
/* Close link to MySQL */
?>
Mam nadzieje ,że mi pomożecie ...
Pozdrawiam