Insert query results in just a blank page

The form below is meant to retrieve the named attribute of a form input called “limitedtextfield” , along side the current date and store those values in a database. The form contains some javascript which can be disregarded for this particular problem.

[php]

				<input  name="limitedtextfield" type="text" onKeyDown="limitText(this.form.limitedtextfield,this.form.countdown,55);" 

				onKeyUp="limitText(this.form.limitedtextfield,this.form.countdown,55);" maxlength="55"><br>

				<font size="1">(Maximum characters: 55)<br>

				You have <input readonly type="text" name="countdown" size="3" value="55"> characters left.</font>

				<input type="hidden" name="submitted" value="TRUE"/>

				<input style="position:relative;left:0px;bottom:0px;" type="submit" name="submit" value="Submit!" />

				</form>

[/php]

Here is the php script that processes the form. What it is meant to do is search the database and if no record is found for the authenticated member, input the relevant values into the database. If a record is found, it should update the record. Well every time I hit the submit button, all I get is a blank page. Any clue as to what is going wrong?

PS: I checked the database and no values got inserted.
[php]

<?php //address error handling ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); //authenticate user require('auth.php'); //Connect to database require ('config.php'); if (isset($_POST['submitted'])) { $query = "SELECT* FROM publications WHERE member_id ='".$_SESSION['id']."' AND cartegory='status'"; $result = @mysql_query($query); $num = @mysql_num_rows($result); if ($num> 0) { $update = mysql_query("UPDATE publications SET publication = '{$_POST['limitedtextfield']}' WHERE member_id = '".$_SESSION['id']."' AND cartegory = 'status'"); header("Location: member.php"); } else { $query = "INSERT INTO publications ( member_id, publication, cartegory, pub_date) VALUES ( '{$_SESSION['id']}','{$_POST['limitedtextfield']}', 'status', NOW() )"; header("Location: member.php"); } } ?>

[/php]

I think you missed mysql_query($query) before redirection ! :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service