PHP Displaying data from MySQL database -
i wanted display page content php , mysql. don't know how select , display data php.
$name = $_get['title']; $query = "select * pages name = $name"; $result = mysql_query("$query");
but don't know how display data. want string value content
in sql table row name = $name
, display it.
if can, please me
you may try , include in code:
$name = mysqli_real_escape_string($_get['title']); $query = "select * pages name = $name"; $result = mysqli_query($link, $query); while ($row = mysqli_fetch_array($result)){ echo $row['content']; } mysqli_free_result($result);
here have assumed $link
handle connect database.
n.b.: may consider passing $_get
values through mysqli_real_escape_string()
avoid sql injections may prove fatal database , tables. need consider usage of mysqli_*
functions because mysql_*
functions deprecated , discontinued.
Comments
Post a Comment