Jump to content

coutts

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

coutts's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yeah i'm at a loss - i will try what usually works - go home, forget about it and come back tomorrow Thanks for your help, I appreciate that you guys really try Robert
  2. ok i thank you for trying - it seems illogical to me - can you think of any reason why the echo statement produces nothing, even when i know that the variable being echoed must have a value
  3. yes i just added AGENT varchar(50) and the latin1_general_ci as are all the other fields (well they have differnt character lenghts) - but the 2 AGENT fields in both tables are the same
  4. yes - the page is called confirmation.php and a link is sent by earlier parts of the program to the email of the recipient (in this case me) so I get a link confirmation.php?passkey=sdfsdf4t65yrgdg etc. I click on this link and the required things happen minus AGENT and the script echos the usual success thing but nothing else regardless of the echo statements I insert
  5. no thats not what i'm saying - i'm saying that I never see any response from an echo statement put in that location (and i tried it again) ie I just don't get any echo
  6. yes that is what I am saying - if nothing was getting put in the table I would nt be so confused - I have echoed these after the line that says echo "Your account has been activated" and after the block you copied above
  7. other than not adding agent - it added all the other info from table 1 to table and deleted the line from table 1 as its supposed to
  8. added die to all such lines - no errors the onlyt screen output is "Your account has been activated"
  9. absolutely know it wasnt left over - i cleared both tables before starting - did the first step and it was all in the first table - used the emailed link and everything is in the second table except AGENT - i cant understand and i dont know why i cant echo out whats going on
  10. No actually it doesnt - bearing in mind that this script works except that the agent variable is not inserted in the new table - I checked by echoing a varaible I nknew was working and AGENT which isnt - neither echoed
  11. Hi Yes i am using varchar(50) in both cases
  12. Hello: The following code moves a series of values from one table to another table as a result of a user clicking on a link that is emailed to them (memebrship signup form) It was working , in fact it still works except it will not being the info on AGENT from the first table (and it is there) to the second table - I have looked this over for hours and cant see anything wrong - would someone have a look and see what I have missed thanks <? $con = mysql_connect("localhost","", ""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("", $con); // Passkey that got from link $passkey=$_GET['passkey']; $tbl_name1=""; // Retrieve data from table where row that match this passkey $sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'"; $result1=mysql_query($sql1); // If successfully queried if($result1){ // Count how many row has this passkey $count=mysql_num_rows($result1); // if found this passkey in our database, retrieve data" if($count==1){ $rows=mysql_fetch_array($result1); $email = $rows["EMAIL"]; $confirm_code = $rows["CONFIRM_CODE"]; $password = $rows["PASSWORD"]; $category = $rows["CATEGORY"]; $price = $rows["PRICE"]; $type = $rows["TYPE"]; $area = $rows["AREA"]; $bedrooms = $rows["BEDROOMS"]; $water = $rows["WATER"]; $land = $rows["LAND"]; $livingarea = $rows["LIVINGAREA"]; $agent = $rows["AGENT"]; $tbl_name2=""; // Insert data that retrieves from "" into table "" $sql2="INSERT INTO $tbl_name2 (EMAIL, PASSWORD, CATEGORY, PRICE, TYPE, AREA, BEDROOMS, WATER, LAND, LIVINGAREA, AGENT) VALUES ('$email', '$password', '$category', '$price', '$type', '$area', '$bedrooms', '$water', '$land', '$livingarea', '$agent')"; $result2=mysql_query($sql2); } // if not found passkey, display message "Wrong Confirmation code" else { echo "Wrong Confirmation code"; } // if successfully moved data from table"" to table "" displays message "Your account has been activated" and don't forget to delete confirmation code from table "" if($result2){ echo "Your account has been activated"; echo( $email ); // Delete information of this user from table "" that has this passkey $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'"; $result3=mysql_query($sql3); } } ?>
  13. I found the problem (and its one of those duh problems) the ; on the end of #create the query $sql = "select SKU, TITLE, DESCRIPTION, PRICE, CATEGORY from tractors"; was missing. New to PHP - used to programming with visual basic - no need to end lines with vb. Thanks for help
  14. Tried all suggestions without any clue. Still getting a blank window <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD> <BODY></BODY></HTML>
  15. I have the following 2 pages. The user enters the SKU number in the form on delete.htm adn the pic file and SQL database entry are deleted in delete.php. Only they arent. Delete.php is a blank page (no errors), and as you can see I echoed SKU and I dont think it is being passed. Any help, thanks This is delete.htm <html> <head> <title>Delete Item</title> <style> td {font-family:arial; font-weight:500; font-size:12px; color:black} </style> </head> <body> <center> <form action="delete.php" method="post" name="addform"> <table align="center" border="1" bgcolor="white" frame="box" bordercolor="black" bordercolorlight="black" bordercolordark="black" cellspacing="0" cellpadding="25" width="640"> <td valign="top"> <table border="0"> <tr><td>SKU</td><td><input type="text" name="SKU" size="15"></td></tr> </table> <input type="submit" value="Delete Item"> </form> </table> </td></table> </center> </body> </html> This is delete.php <html> <head> <title>Delete Item</title></head> <body bgcolor="#FFFFFF"> <?php $sku = $_POST["SKU"]; echo( $sku ); #connect to MySQL $conn=@mysql_connect( "localhost", "", "") or die( "Err:Conn" ); #select the specified database $rs = @mysql_select_db( "tractors", $conn ) or die( "Err:Db" ); #create the query $sql = "select SKU, TITLE, DESCRIPTION, PRICE, CATEGORY from tractors" #execute the query $rs = mysql_query( $sql, $conn ); #write the data while( $row = mysql_fetch_array( $rs ) ) { $sql = "DELETE FROM tractors WHERE SKU=$sku"; $pics = "../pics/" . $row["SKU"] . ".jpg"; unlink( $pics ); $result = mysql_query($sql); echo( "<br><br><br><br><table align='center' border='3' bgcolor='white' frame='box' bordercolor='black' bordercolorlight='black' bordercolordark='black' cellspacing='0' cellpadding='10'><td>" ); echo( "<font face='arial' color='black' size='3'>Item " . $row["SKU"] . " has been deleted."); echo( "</td></table>" ); mysql_close($sql); } ?> </body> </html>
×
×
  • 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.