[MySQL&PHP] SELECT `cos` FROM `xxx` WHERE `id` = 1

0
//mysql connect i inne pierdoly...


$sql_aut = "SELECT `author` FROM `".$mysql_table."` WHERE `id`='".$_GET['edit']."';";
$news_author = mysql_query($sql_aut);


Resource id #n

Dlaczego taki błąd wyskakuje.. :( laduje $news_author do inputa... </php>

PS.

Zapytanie: SELECT title FROM news WHERE id='6';

Wynik : Resource id #15

PS2. W PhpMyAdmin gdy to wpisuje jest wszystko OK!

0

id=".$_GET['edit']."

//po co źle podpowiadasz? - M

0

to samo -.-

0
$new_author = mysql_fetch_array(mysql_query($sql_auth));

PS. to temat raczej do działu php, przenoszę.

0

wtedy

$news_author = 'Array'
$sql_aut = "SELECT `author` FROM `$mysql_table` WHERE `id`=".$_GET['edit'].";";
$news_author = mysql_fetch_array(mysql_query($sql_aut));
0

bo mysql_fetch_array zwraca tablice....

odnosisz sie przez:

$news_author['author'];

albo możesz użyć mysql_fetch_row i odnosisz się wtedy poprzez:

$ktore_to_pole_tabeli = 1; // dla układu np. id, author, ..., ...
$news_author[$ktore_to_pole_tabeli];

afair

0

hmm...
a tutaj tez uzycz fetch_array ?

$update = "UPDATE $mysql_table SET title = '".$_POST[title]."', author = '".$_POST[author]."', content = '".$_POST[content]."' WHERE title = '".$news_title."' ;";
if (mysql_query($update)) {
echo "<script>alert(\"Zmiany zostały zapisane!\")</script>";
}
0

Tutaj nie.

http://pl.php.net/mysql_fetch_array
http://pl.php.net/mysql_query

PS. średnik jest niepotrzebny przy zapytaniach w mysql_query

0

tylko to chcialem ;PP thx..

1 użytkowników online, w tym zalogowanych: 0, gości: 1