Jump to content

error maybe its not sending to the db


BillyBoB

Recommended Posts

[code]
<?php
if($_POST[submit])
{
$query = mysql_query("SELECT * from profile where username = '$_GET[user]'") or die(mysql_error);
$profile = mysql_fetch_array($query);
$aim = $_POST[aim];
$msn = $_POST[msn];
$yim = $_POST[yim];
$website = $_POST[website];
$gender = $_POST[gender];
$age = $_POST[age];
$location = $_POST[location];
if($aim==NULL|$msn==NULL|$yim==NULL|$website==NULL|$gender==NULL|$age==NULL|$location==NULL)
{
echo("You have left a spot empty!");
}else{
$query = mysql_query("UPDATE profile SET (aim = '$aim',msn = '$msn',yim = '$yim',website = '$website',gender = '$gender',age = '$age',location = '$location') WHERE username = '$logged[username]'");
}
}
?>
[/code]

i try to use this but it does't work can u help me?
Link to comment
Share on other sites

Change the bitwise operator | to the logical or operator of || in your "if" statement. See:

http://us2.php.net/manual/en/language.operators.logical.php

Take out the left and right parenthesis in the UPDATE. See:

http://dev.mysql.com/doc/refman/4.1/en/update.html
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.