Hi,

I am trying to develop a blog and stuck up in managing the blogs.

The logic with which I am working is that the user who has logged in should be able to see his or her own blog to manage it of course. Now for this I have successfully inserted the email in my blog table, thanks to this forum.

In order to show the blogs the user has written, I have made the following code.

if (isset($_SESSION['MM_Username'])) {
  $colname_rec_manage_blog = $_SESSION['MM_Username'];
}
mysql_select_db($database_con_reg, $con_reg);
$query_rec_manage_blog = sprintf("SELECT * FROM blog WHERE email.blog = %s", GetSQLValueString($colname_rec_manage_blog, "text"));

This code does not do anything... Gives me a blank record, however the blog has been successfully added in the database. It should pick the blog looking at the email field in the table. It does not give me any error either.

Any help regarding this would be highly appreciated.

Regards,

Bilal A. Khan

Recommended Answers

All 2 Replies

Member Avatar for diafol

You've created the query string, but haven't run it (mysql_query).

You've created the query string, but haven't run it (mysql_query).

Sorry for not posting the whole code. Please see the whole code:

if (isset($_SESSION['MM_Username'])) {
  $colname_rec_manage_blog = $_SESSION['MM_Username'];
}
mysql_select_db($database_con_reg, $con_reg);
$query_rec_manage_blog = sprintf("SELECT * FROM blog WHERE email.blog = %s", GetSQLValueString($colname_rec_manage_blog, "text"));
$query_limit_rec_manage_blog = sprintf("%s LIMIT %d, %d", $query_rec_manage_blog, $startRow_rec_manage_blog, $maxRows_rec_manage_blog);
$rec_manage_blog = mysql_query($query_limit_rec_manage_blog, $con_reg) or die(mysql_error());
$row_rec_manage_blog = mysql_fetch_assoc($rec_manage_blog);

I have set the mysql_query() as well. Can you please help me out now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.