Jump to content

dougjohnson

Members
  • Posts

    98
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Wichita, KS

dougjohnson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How would I create a prepared mysql temp table using PHP? I currently write my prepared statements like the example below. How would I create a "TEMP" table? Thanks! $connection8y = new mysqli("host", "xxx", "xxx", "db"); $result8y = $connection8y->prepare("SELECT ordernum, ordertype, duedate FROM hedord WHERE custnum = ? AND ordertype = ?"); $result8y->bind_param("ss", $custnum, $theordertype); $result8y->execute(); $bindok8y = $result8y->bind_result($ordernum, $ordertype, $duedate, $yyy, $mmm, $ddd); while ($bindok8y && $myrow8y = $result8y->fetch()) { echo "$custnum $ordernum $ordertype $duedate $yyy-$mmm-$ddd<br>"; }
  2. Can you determine which of the records does NOT have the last field, and before inserting it just add a blank value into that field?
  3. I think you are always going to need 2 items to pass a variable using a URL. First is the variable name to be passed and second is the variable value to be passed. So... urlstuff?membername=<? echo $membernamevalue; ?> that might work? On the receiving end: $membername = $_GET["membername"];
  4. Try this? $db = mysql_connect($host, $username, password) or die("Could not connect: " . mysql_error()); mysql_select_db("dbname",$db) or die(mysql_error());
  5. Example: $db = mysql_connect("localhost", "dummy", "password") or die("Could not connect: " . mysql_error()); mysql_select_db("dbname",$db) or die(mysql_error());
  6. I think you need to separate your connection variables with commas.
  7. First, I'm assuming the script we are talking about is ONLY displayed once upon logging in. If it is used more than once you would need to POST the username to it each time. Or you would get the results you are talking about. Probably won't help?
  8. This is happening to our php scripted emails more and more often. If anyone knows something that can be done about this it would be helpful. One thing that might cause some of your emails to be "blocked" is the link within the email? Maybe some filters can be set to detect links and automatically block them. I know this isn't much help but I just wanted to chime in.
  9. I don't know if this will help since we don't use IIS but here's how we do it: function mylogin($username, $password) { $password = addslashes($password); $ldap = @ldap_connect("server.name.com") or die("Could not connect to LDAP server."); // must be a valid LDAP server! if ($ldap) { $bind_results = @ldap_bind($ldap,"cn=" . $username . ",o=tree_name", $password) or die("Please try again."); $dn = "o=tree_name"; $filter="(|(cn=" . $username . "*))"; $nds_stuff = array("title", "sn", "givenname", "mail"); $results=ldap_search($ldap, $dn, $filter, $nds_stuff); $info = ldap_get_entries($ldap, $results); if ($info["count"] != 0) { $_SESSION["login"] = Y;
  10. Are the fields you're referencing in the INSERT statement in your database "exactly" as you have them typed?
  11. You're on the right track. Now just start adding fields and testing after each add. Eventually you'll find the field that's causing the problem. It will be painful but worth it:-) I'm out for the rest of the morning. Good luck.
  12. Let's simplify things and try it. $e_name = $_POST['evaluator_name']; /* data type = text in the table. Also there is one more attribute in the table caled ID with autoincrement */ $aname = $_POST['aname']; /* data type = text */ $sapid = $_POST['sapid']; /* data type = text */ $processing_date = $_POST['processing_date']; /* data type = date */ $review_date = $_POST['review_date']; /* data type = date */ $contact = $_POST['contact_ID']; /* data type = text */ $audit_type = $_POST['audit_type']; /* data type = text */ $case_no = $_POST['case_no']; /* data type = integer */ $product_name1 = $_POST['product_name1']; $product_name2 = $_POST['product_name2']; $product_name3 = $_POST['product_name3']; $product_name4 = $_POST['product_name4']; $product_name5 = $_POST['product_name5']; $product_name6 = $_POST['product_name6']; $product_name7 = $_POST['product_name7']; $product_name8 = $_POST['product_name8']; $product_name9 = $_POST['product_name9']; $product_name10 = $_POST['product_name10']; $product_name11 = $_POST['product_name11']; $product_name12 = $_POST['product_name12']; $product_name13 = $_POST['product_name13']; $product_name14 = $_POST['product_name14']; $product_name16 = $_POST['product_name16']; $Para_A_A1_score = $_POST['Para_A_A1_score']; $Para_A_A2_score = $_POST['Para_A_A2_score']; $Para_A_A3_score = $_POST['Para_A_A3_score']; $Para_A_A4_score = $_POST['Para_A_A4_score']; $Para_A_A5_score = $_POST['Para_A_A5_score']; $Para_A_A6_score = $_POST['Para_A_A6_score']; $Para_A_A1_Comment = $_POST['Para_A_A1_Comment']; $Para_A_A2_Comment = $_POST['Para_A_A2_Comment']; $Para_A_A3_Comment = $_POST['Para_A_A3_Comment']; $Para_A_A4_Comment = $_POST['Para_A_A4_Comment']; $Para_A_A5_Comment = $_POST['Para_A_A5_Comment']; $Para_A_A6_Comment = $_POST['Para_A_A6_Comment']; $query = "INSERT INTO test (e_name, agent_name) VALUES ($evaluator_name, $aname)"; $result = mysql_query($query) or die("Error while inserting data" . mysql_error()); mysql_close($connection); Does it work now? If so, start adding back some of the other field inserts.
  13. I'm not sure what your "." "." are in your insert? I've never seen that before?!? Also, what are the "{" "}" for? Try changing your INSERT to: $query = "INSERT INTO test (e_name, agent_name, userid, processing_date, review_date, contact_ID, audit_type, case_no, product_name, duration, errors, mark_parameter_A, mark_parameter_B, mark_parameter_C, mark_parameter_D, mark_parameter_E, mark_parameter_F, mark_parameter_G, mark_parameter_H, mark_parameter_I, mark_parameter_J, Total_Possible, Score, Para_A_A1, Para_A_A2, Para_A_A3, Para_A_A4, Para_A_A5, Para_A_A6, Para_A_A1_Comment, Para_A_A2_Comment, Para_A_A3_Comment, Para_A_A4_Comment, Para_A_A5_Comment, Para_A_A6_Comment) VALUES ($evaluator_name, $aname, $sapid, $processing_date, $review_date, $contact_ID, $audit_type, $case_no, $product_name1, $product_name2, $product_name3, $product_name4, $product_name5, $product_name6, $product_name7, $product_name8, $product_name9, $product_name10, $product_name11, $product_name12, $product_name13, $product_name14, $product_name16, $Para_A_A1_score, $Para_A_A2_score, $Para_A_A3_score, $Para_A_A4_score, $Para_A_A5_score, $Para_A_A6_score, $Para_A_A1_Comment, $Para_A_A2_Comment, $Para_A_A3_Comment, $Para_A_A4_Comment, $Para_A_A5_Comment, $Para_A_A6_Comment )"; You'll need to make sure every field name has a matching value.
  14. Para_A_A6_Comment,) That last coma before the ) VALUE should not be there.
×
×
  • 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.