Jump to content


Photo

error maybe its not sending to the db


  • Please log in to reply
1 reply to this topic

#1 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 14 July 2006 - 04:21 AM

<?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]'");
}
}
?>

i try to use this but it does't work can u help me?

#2 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 14 July 2006 - 06:05 AM

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

http://us2.php.net/m...ors.logical.php

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

http://dev.mysql.com.../en/update.html





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users