Jump to content

swatisonee

Members
  • Posts

    253
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

swatisonee's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Oh thanks ! Where I get stuck is at the product_quote stage. But I am going to study your solution now.
  2. Hi. I have a product database w/ tables each for product series, model, sub-model and optionals. One item in each of these makes up one product. So Series K, Model 7, sub-model 2, optional 3 will be a product called K 7/2-3 .The permutations and combinations of these are all possible products. In the same db, I have a quotations table. Each quotation has a unique id / record. A quotation can include any number of products : it can have K 7/2-3, KA 561/1-2 , FPN 311/2-1 or it can only have KA 561/1-2 etc. Now I am stuck. Don't know how to a. structure the quotations table b. create a MySQL select so that one statement can make multiple selections . I thought of using a checkbox but that doesn't work either since the series/model/sub model/optionals must chosen sequentially. Any ideas I can follow thru ? Many thanks Swati
  3. Scrambled. I know I am missing something but cant see it ! Pointers please ! Thanks :-)
  4. I have a simple login script and db DB fields : un,pw, date, sessionid and ip. The login script is also a pretty simple one . I want to be able to add a line of code that forces pw change every 90 days. Any suggestions please? What could I add and where ? The operative part of the code here. Thanks. //Process this if statement only if form was submitted if($_POST['submit']){ session_start(); //session_register("session"); $username=$_POST['username']; $password=$_POST['password']; $ip=$_SERVER['REMOTE_ADDR']; // To protect MySQL injection $myusername = stripslashes($username); $mypassword = stripslashes($password); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $encrypted_mypassword=md5($mypassword); include ("../NEWDBS.php"); //db info for DB2 //Test for login success $sql = "SELECT * FROM Users WHERE Username='$myusername' AND Password = '$encrypted_mypassword'"; $result = mysql_query($sql); if ($myrow = mysql_fetch_array($result)){ $login_success = 'Yes'; $sql2= "insert into Log(blah blah ...) "; if($_POST['submit'] && ($login_success == 'Yes') ){ $successMessage = '<p class="data"><center><font face="Antique Olive" size=2>Thank you for logging in '.$username.' !<br /><br />'; }
  5. So here is what I did. Turned on compatibility view for IE10. The original code started working in IE and FF but not Chrome. Seems to be a javascript issue as the error in Chrome is "cannot read property value or null" . What can I check to resolve this please? Thanks.
  6. While on the subject, I know there are several datepickers around. Can someone recommend a real simple one please? I need to pick atleast 3-4 dates in one form and then have it pass in yyyy-mm-dd format to a MySQL database. Thanks.
  7. Ok, here's something I found out. The datepicker pops up, a date can be selected but the variable doesn't pass thru the form on submit when <input type=text id="todate" size=12> However, when <input type=text name="todate" size=12> the datepicker doesn't pop up nor does the date get selected. However, if one types the date in the input box, the variable passes thru the form and gets submitted. Why does the selection of id or name make a difference and how do I resolve this please? also, could this be an issue with javascript? thanks
  8. Earlier when one clicked on the cal.gif icon ,the current month would appear and one could choose a date. Now clicking on the icon doesnt have the month's calender pop up.
  9. Hi, My web hosting co. upgraded to php 3.4.11.1 . I was using My Datepicker from rainforest.net http://www.rainforestnet.com/datetimepicker/datetimepicker.htm and all of sudden it just doesn't work. It has worked so beautifully all these years - I have never even customised it and all of sudden I cannot figure out why Newcsscal isn't getting called. Here is the part that I use . Any pointers on what could be going wrong and what I need to do ? Thank You ! <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <title>Contacts</title> <link type="text/css" rel="stylesheet" href="NEWDBS/cssfiles/leave.css"> //<script src="./datepicker/datetimepicker_css.js"></script> // per the script creator it should be in the head but since we're calling the form, I would have it called in the body below </head> <body bgcolor=white lang=EN-IN link=blue vlink=purple> <div class=Section1> <div align=center> <form action="<?php print $PHP_SELF ?>" method="post"> <input type="hidden" name="userid" value="<? echo $userid ?>"> <input type="hidden" name="usertype" value="<? echo $usertype ?>"> <?php } else { ?> <FORM METHOD=post ACTION="<? echo $PHP_SELF ?>"> <script src="./datepicker/datetimepicker_css.js"></script> blah blah.... <input type=text name="todate" size=12> <a href="javascript:NewCssCal('todate', 'yyyymmdd')"> <img src="./datepicker/images/cal.gif" width="16" height="16" alt="Pick a date"></a></span></p>
  10. Well this is what finally worked. SELECT * FROM Customers c RIGHT OUTER JOIN Reports r USING (CID) GROUP BY c.`Company` asc Thanks . S
  11. Folks...anything you can spot on what might be going wrong with this code ? Much obliged. Thanks.
  12. Hi: I have the foll. code. The table "Reports" has multiple records for a given value of CID in the Field CID. I'd like to be able to select only 1 of them so that a list of customers appearing in the Reports table is available for selection in the dropdown alphabetically. The foll. code does it but it doesnt list the Customers alphabetically. And when I use Join, the query doesnt run. I get a blank list . The Field CID is common to both tables- Reports and Customers. Could someone help me with the Join ? Thanks. Swat <?php $sqlco = "SELECT DISTINCT CID FROM `Reports` "; $resultco = mysql_query($sqlco) or die (mysql_error() ) ; if ($myrowco = mysql_fetch_array($resultco) ) { do { $cid = $myrowco["CID"]; $sqlrep = "SELECT * FROM `Customers` WHERE `CID` = '$cid' " ; $resultrep = mysql_query($sqlrep) or die (mysql_error() ) ; $myrowrep = mysql_fetch_array($resultrep); $company = $myrowrep["Company"]; printf("<option value=%d> %s , %s", $myrowco["CID"], $myrowrep["Company"], $myrowco["Mdate"]); } while ($myrowco = mysql_fetch_array($resultco)); } else { echo "No records found." ; } ?></select></a> What i tried was this : <?php $sqlco = "SELECT DISTINCT CID FROM `Reports` r JOIN `Customers` c WHERE r.CID = c.CID ORDER BY c.Company asc "; $resultco = mysql_query($sqlco) or die (mysql_error() ); if ($myrowco = mysql_fetch_array($resultco) ) { do { printf("<option value=%d> %s ", $myrowco["CID"], $myrowco["Company"]); } while ($myrowco = mysql_fetch_array($resultco)); } else { echo "No records found." ; } ?>
  13. Sorry Pikachu missed seeing this post. I kept looking at the code and just could not figure out what was wrong - hence posted the whole thing. Then decided to bypass MAX. FWIW, can you look at the code i posted in reply to PFMaBiSmAd . Thanks !
  14. I gave up on MAX. I converted the query as under : $sqlb = "SELECT (`QD`) FROM `Qts` WHERE `OCID` = '$ocid' ORDER BY `QD` DESC LIMIT 1 " ;" ; Worked.
  15. Pikachu, Doesnt the code need to run thru the entire table to check for all records where OCID = $ocid and then selecting the most recent date?
×
×
  • 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.