Jump to content

highaspen

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by highaspen

  1. Okay I think I know what is going on... I'm querying the DB to see which fields are empty. by doing this: -------------- $call1 = $row['call1']; $call2 = $row['call2']; $call3 = $row['call3']; $call4 = $row['call4']; $call5 = $row['call5']; $call6 = $row['call6']; $call7 = $row['call7']; $call8 = $row['call8']; $call9 = $row['call9']; $call10 = $row['call10']; -------------- if a field is empty it is saying it is "undefined" right? so I should set a default value in the DB then compaire that? right?
  2. Okay.. getting somewhere now... I think. Here is what I got. ------------- Notice: Undefined variable: list3 in /var/www/vhosts/remindem.com/httpdocs/mxi/membersignup3.php on line 231 Notice: Undefined variable: list4 in /var/www/vhosts/remindem.com/httpdocs/mxi/membersignup3.php on line 261 -----------
  3. ok I lied... the $callid is being passed in an image... <input type='image' src='images/addreminder.jpg' name='callid' value='59'> maybe IE doesn't like that huh?
  4. The interesting thing is... Mozilla is fine with it. CRAZY!
  5. Viewing the source, it is set and is being passed in a hidden field.
  6. Interesting... it gave me this: UPDATE xocai SET call1='' WHERE id='157' but my code looks like this: $sql6="UPDATE xocai SET call1='$callid' WHERE id='$id'";
  7. As far as what doesn't work... it doesn't write to the DB. but doesn't give me an error either, just redirects the the header as if it did write.
  8. sorry really new at php.. what are code tags?
  9. Here is the code that is writing to the DB ---------------------- while($row= mysql_fetch_array($rs) ) { if (!$row['call1']){ $sql6="UPDATE xocai SET call1='$callid' WHERE id='$id'"; $rs6=mysql_query($sql6,$conn) or die("Could not execute query". mysql_error()); header ("location:../../membersignup3.php?id=$id&org=$org"); exit(); ----------------- Site link is: www.remindem.com/mxi Set up a membership (first option) and I'm having trouple on the second page (membersignup3.php)
  10. Hummm... yeah, I have the privacy setting on low and have the domain set as a site to accept cookies.
  11. Anybody know why a PHP script that runs fine in Mozilla will not run in IE? I'm just doing a simple MySQL record update.
  12. I've seen this done before and I think I've done it... hewre is waht I've got and the output only populates the variables from the first query and seems to ignore the second query. I've checked my data and I should have some values here in the second query. Any help would be appreciated. --------------- $conn=@mysql_connect("localhost", "$dbuser","$dbpass") or die("Could not connect". mysql_error()); $rs = @mysql_select_db($db, $conn) or die("Could not select database". mysql_error()); $sql="SELECT * FROM reminders WHERE dom='$today' AND timehour='$thishour' AND timeminute='$thisminute' AND active='yes'"; $rs=mysql_query($sql,$conn) or die("Could not execute query". mysql_error()); while($row= mysql_fetch_array($rs) ) { $callname = $row['name']; $callid = $row['callid']; $timehour = $row['timehour']; $timeminute = $row['timeminute']; $meridian = $row['meridian']; $callinno = $row['callinno']; $passcode = $row['passcode']; $locationname = $row['locationname']; $locationaddress = $row['locationaddress']; $locationcity = $row['locationcity']; $locationstate = $row['locationstate']; $locationcountry = $row['locationcountry']; $sql2="SELECT * FROM xocai WHERE active='yes' AND call1='$callid' OR call2='$callid' OR call3='$callid' OR call4='$callid' OR call5='$callid' OR call6='$callid' OR call7='$callid' OR call8='$callid' OR call9='$callid' OR call10='$callid'"; $rs=mysql_query($sql2,$conn) or die("Could not execute query". mysql_error()); while($row= mysql_fetch_array($rs) ) { $list .="$firstname = ".$row2["firstname"]." $address = ".$row["areacode"]."".$row["prefix"]."".$row["suffix"]."".$row["carrier"].""; echo ($list); if (!$list ) echo("busted"); } }
  13. okay, I've tried writting this several different ways each not working. I'm sure it's something stupid. Here is what I've got. ------------------------ $rs=mysql_query($sql,$conn) or die("Could not execute query"); if (!$rs){ include ("somepage.php"); exit();} else{ then I've got a bunch of code here. } ------------------------ The problem I'm having is, the if statment is continually ignored and only displays the else. I've rigged the database so that the if statment will be true, yet it still fails. I've also tried this using if ($rs == "null") with the same results. And if($rs==NULL). Any help would place the helper in GOD status in my mind. Thanks
  14. [!--quoteo(post=357005:date=Mar 21 2006, 09:31 AM:name=micah1701)--][div class=\'quotetop\']QUOTE(micah1701 @ Mar 21 2006, 09:31 AM) [snapback]357005[/snapback][/div][div class=\'quotemain\'][!--quotec--] $sql='SELECT owner FROM members WHERE owner="$valid_user"'; $rs=mysql_query($sql,$conn); $rows_returned = mysql_num_rows($rs); echo $rows_returned; [/quote] Thanks man... lookis like it's working. Cheers.
  15. I think I just need some help thinking through this. I'm using the query below but it's returning 0 and I knwo that to be innacurate. $sql='SELECT COUNT(*) FROM members WHERE owner="$valid_user"'; Here is what I want it to do: count the number of times the $valid_user appears in the owner column in the members table. I'm wondering if I have a logic problem. I'm not getting any mysql errors during the query but when calling the aray in to the page using: <? echo ($rs['0']); ?> I'm getting zero. Below is the full code for my query (FYI). Thanks to all you smart people helping this dumb guy. -------------------------------- include ("../global_vars.php"); $valid_user = $_POST['userid']; $conn=@mysql_connect("$dbserver", "$dbuser","$dbpass") or die ('Could not connect. Error: ' . mysql_error()); $rs = @mysql_select_db("$dbtable", $conn) or die ('Could not select database. Error: '. mysql_error()); $sql='SELECT COUNT(*) FROM members WHERE owner="$valid_user"'; #execute the query $rs=mysql_query($sql,$conn) or die('Could not execute query. Error: '. mysql_error()); $rs = mysql_fetch_array($rs);
  16. Thanks here is the mqsql error I get. Could not execute query. Error: You have an error in your SQL syntax near 'from members WHERE owner=demo ' at line 1
  17. I'm attempting to run a simple record count with the code below. It returns the die on the $rs -------------------- <?php include ("../global_vars.php"); $valid_user = $_POST['userid']; #connect to MySQL $conn=@mysql_connect("$dbserver", "$dbuser","$dbpass") or die("Could not connect"); #select the specified database $rs = @mysql_select_db("$dbtable", $conn) or die("Could not select database"); #create the query $sql="SELECT COUNT(*) FROM from members WHERE owner='$valid_user' "; #execute the query $rs=mysql_query($sql,$conn) or die("Could not execute query"); $rs = mysql_fetch_array($rs); ?> ------------------------------ any ideas? I appreciate any insight... rather new at this. thanks.
  18. Scratching my head on this one... just trying to add .5 to a value in a mySQL table. Here's where I am on this. I'm not getting a failure, just doesn't write. -------------- <?php include ('../global_vars.php'); $owner = $_COOKIE['leadowner']; #assigns value from cookie #connect to MySQL $conn=@mysql_connect("$dbserver", "$dbuser","$dbpass") or die("Could not connect"); #select the specified database $rs = @mysql_select_db("mychocolatedrink", $conn) or die("Could not select database"); #create the query $sql="UPDATE members SET credits=(credits + .5) WHERE user_name='$owner'"; #execute the query $rs=mysql_query($sql,$conn) or die("Could not execute query"); ?> -------------------------- The column I'm trying to add .5 to is "credits" for a specific record identified in the "user_name" column. Thanks in advance
  19. I'm trying to redirect the browser by inputing a dynamic URL from a database. Here is the code after the database login procedure. __________________ $rs=mysql_query($sql,$conn) or die("Could not execute query"); $list ="<html>"; while($row= mysql_fetch_array($rs) ) { $list.="<meta HTTP-EQUIV=Refresh CONTENT='1;URL=".$row["productlink"]."></html>"; } echo($list); ?> _____________________ What happens is the browser looks like it's in an endless loop. I'm guess there is a better way to do this. ANy ideas? Thanks in advance.
  20. Does anybody out there know the mySQL syntax to not update a record if the input field is null?
×
×
  • 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.