PHP MySQL common mistakes

can anyone teel me if this is correct
$news = @mysql_query('SELECT Noticia FROM noticias WHERE id = 1');
{
echo ($news);
}

it was ment to be one line only
so is it corectr or not?
blackdeat: well if you intend to echo the result handle, then it's correct.
but it does not work as i want it to
blackdeat: That's because you're not doing what you want to do.
lol
help
blackdeat: php.net/mysql_fetch_assoc
im reading one already
but ill look
blackdeat: or mysql.tregt.net/showdata.php
blackdeat: You see, mysql_query returns what we call a result handle. You need to extract the rows you want from it. You
do this with mysql_fetch_array or mysql_fetch_assoc.
i had array before
but it still give me the wrong one
so ill try the assoc one
brrr now nothing comes up
blackdeat: $result=mysql_query("SELELCT Noticia from noticias WHERE id = 1") or die(mysql_error()); $row=mysql_fetch_ass
oc($result); var_dump($row);
SELELCT ?
it's sql 2.0
now it comes up
but with some extre things
lol
rza: Yes, it's the "new and improved"(tm) way of doing things.

rza: also known as "the enterprise way"(tm) or "managements good idea"(tm)
enterprise frameworks bundled with enterprise web 2.0 support
"Ofcourse we tested it… :) "

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Leave a Comment

You must be logged in to post a comment.


Blog Tags:

Similar posts: