Why wont this work? PHP and MySQL HELP!

I am creating a website where writers can share stories, in the upload script there is a option to save a file as a draft. If the user checks this option, a Y is put in a row in my mysql database called draft.
Here is the structer of my mysql db
[hr]
title sum notes story user story_id cat rating series_id chap_numb draft
[hr]
In the page where the drafts for that user is displayed (called draft) I want to list all of that users drafts, but it doesn’t seem to be working. I check the sourse and any field that I use a variable for is left blank. Here is the code on the page:
[php]

<?php if (isset($user_log)) { //************************************************************************************************************************************************ $user = $_SESSION['user']; $query = " SELECT * FROM story_info WHERE user = '$user' AND draft = 'Y' "; $select = mysql_query($query) or die(mysql_error()); echo mysql_num_rows($select); if (mysql_num_rows($select)!=0) { while($rows = mysql_fetch_assoc($select) or die(m) ); { $titledb = $rows['title']; $sumdb = $rows['sum']; $id_db = $rows['story_id']; $notesdb = $rows['notes']; $storydb = $rows['story']; $catdb = $rows['cat']; $ratdb = $rows['rating']; $userdb = $rows['user']; $seriesid_db = $rows['series_id']; $chapnumb = $rows['chap_numb']; echo "

$titledb

$sumdb
"; } } else { echo "
No Drafts!
"; } //************************************************************************************************************************************************* } else { echo "
Please sign in to view this page!
"; } ?>

[/php]
Here is the code on the template page:

<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type='text/javascript'>
function checkForm() 
{
if (document.getElementById(yob) == undefined)
{
	alert('Enter Year Of Birth!');
	
}

}
</script>
<style type="text/css">
#message 
{
	font:Arial, Helvetica, sans-serif	;
	text-align:center;
	font-size:2em;
	
}
#error
{
	border-width:2px;
	border-style:dashed;	
	border-color:#F00;
	background-color:#F96254;
	margin:auto;
	width:500px;

}
label 
{
	display:block;
}

#impor
{
	color:#F00;
	font-weight:bold;
}
.story 
{
	background-color:  #E6EFF9;
	width: 801px;
	float:right;
	padding:10px;
	margin-right:375px;
	margin-bottom:10px;
}
.story_info
{
	background-color:#A3ACB5;
	width:217px;
	min-height: 755px;
	
}

	.info 
{
 	width: 1900px;
	background-color:#44719D;
	height:50px;
}
	
	
	

</style>
<?php

if (isset($_COOKIE['user']))
{
	$user_log = $_COOKIE['user'];
}
else
{
	$user_log = $_SESSION['user'];	
}
 ?>
<?php include('logic.inc'); mysqlConnect(); ?>
<script type="text/javascript" src="bbeditor/ed.js"></script>
<link rel="stylesheet" type="text/css" href="bbeditor/styles.css" />
<title>
<?php
echo 'social';
?>
</title>
<script type="text/javascript">
function changeTitle(title) 
{
	 document.title = title; 
}
</script>

</head>

<body>
<div class="content">
  
    <?php
	//enbed a page
@$page = $_GET['p'];
$path = "inc/$page.php";
//check if file exsists

if (file_exists($path))
{
	include($path);
}
//if not desplay message
else 
{
	die("<div id='message'> Page doesn't exsist. </div>");
}

/*
$rand = rand('1','2');
$include = "spon/spon$rand.php";
include($include);
*/

?>
</div>

</body>
</html>

What do you think is wrong :frowning:

:(. I posted in the wrong area. I reposted in the General Php Section. I am not sure how to delete this.

Sponsor our Newsletter | Privacy Policy | Terms of Service