456 PHP i MySQL dla każdego
iftSrow = @mysql_fetch row(Sresult)){
$id - $row[0]:
Sheader = $row[l];
Scontents - $row[2]:
$button_name - 'Modyfikuj':
Saction = 'modify': include "news_form.php”: echo($news_form codę);
function modifyMessage($newsId. $header. Scontents)
$query = "UPDATE News SET Nagiowek='Sheader'.
$query .= "Tresc-'Scontents' WHERE Id-Snewsld":
if(!@mysql_query($query)){
//echo("Odrzucone zapytanie: funkcja modifyMessage"): return false:
return mysql_affected_rows();
i f(!i sSet(S_SESSI0N['Userld'])){ return false:
Squery = ''INSERT INTO News VALUES(":
Squery "NULL. S_SESSION[UserId]. ":
$query .='"Sheader'. 'Scontents'. NOWO)";
if(!@mysql_query($query)){
//echo("Odrzucone zapytanie: funkcja addMessage"): return false:
return @mysql_affected_rows():
function deleteMessage(SnewsId)
Squery - "DELETE FROM News WHERE Id-$newsld ":
$query .= "ANO UserId=$_SESSION[UserId]n:
if(!@mysql_query($query)){
//echo("Odrzucone zapytanie: funkcja deleteMessage"); return false;
return mysql_affected_rows():
function showAHNews(Spage. SpageSize)
Squery - "SELECT News.Id. Nagłówek. Tresc. Data. Nazwa ": Squery .= "FROM News. Users ":
Squery .= "WHERE Users.Id = News.Userld ":
Squery .- "ORDER BY Data DESC";