Jump to content

$username

Members
  • Posts

    159
  • Joined

  • Last visited

    Never

Everything posted by $username

  1. Here is my revised code echo ("<td><select name=\"WebCaseTypeSet\">".$no_opt. "</option>" .$yes_opt. "</option></select><big></big></td>"); I also have this that is doing to MYSQL work $sql202 = "SELECT WebID, WebCasesType, WebCaseTypeSet FROM webdisplay"; $query202 = mysql_query($sql202); while($row202 = mysql_fetch_array($query202)) { $no_opt = '<option value="No" '; $yes_opt = '<option value="Yes" '; if ($row202["WebCaseTypeSet"] == "No") $no_opt .= 'selected=selected'; else $yes_opt .= 'selected=selected'; $no_opt .= '>'; $yes_opt .= '>';
  2. Hello PHPers I am working on making a drop down box with in my PHP echo. Can some let me know if this is right? echo ("<td><select name=\'WebCaseTypeSet'>".$no_opt. "</option>" .$yes_opt. "</option></select><big></big></td>");
  3. So I have this code and I am trying to pull info from more then one table. i think I am close to getting this. It does not display the info as of now. Thanks <br \> <table width="900" border="2" rules="all" cellpadding="2" cellspacing="2" bordercolor="#000000" > <tr bgcolor="#CCCCCC"> <td><strong>Case ID:</strong></td> <td><strong>Contact Email</strong></td> <td><strong>Contact Phone</strong></td> <td><strong>Contact Fax</strong></td> </tr> <?PHP $AccNumber = $_GET['AccNum']; $sql162 = "SELECT cases.CaseID, cases.CaseSubject, cases.CaseOwner, cases.CaseAccountID, contacts.ContactFname, contacts.ContactLname, contacts.ContactAccountNumber, account.AccountName, account.AccountNumber FROM cases, contacts, account WHERE CaseAccountID = '$AccNumber' LIMIT 0,9"; $query162 = mysql_query($sql162); while($row162 = mysql_fetch_array($query162)) { //echo "<tr>"; echo "<tr>"; //echo("<td><a href=\"viewaccount.php?AccNum=" . $row["AccountNumber"] . "\" title=\"".$row["AccountID"]."\">" . $row["AccountID"] . "</a></td>"); echo "<td>".$row162['ContactFname']."</td>"; echo "<td>".$row162['CaseSubject']."</td>"; echo "<td>".$row162['CaseOwner']."</td>"; echo "<td>".$row162['AccountName']."</td>"; echo "</tr>"; } ?> </table>
  4. Hello People, I need to do a select on a field from a table in MYSQL and then make that select equal a variable. I am not able to do so with my code. can someone tell me what I am doing wrong Here is my code <?PHP include 'dbopen.php'; include 'dbconnect.php'; $username = ($_COOKIE["user"]); $RandomGen = ($_COOKIE["RandomGen"]); echo "<br>Random Value = ".rand(1000000000,9999999999); print_r($_COOKIE); //SELECT RandomGen FROM `admin` WHERE username = \ 'test\' $sql102 = mysql_query("SELECT RandomGen FROM admin WHERE username = '$username'"); $row102 = mysql_fetch_array($sql102) or die ("no data"); $RandomGenDB = $row102; echo $RandomGenDB, $username, $RandomGen ; ?>
  5. The best way to do the project is to define what you want done plane out the way and features that you are going to use. Then from there start the code. the manual is one why to do it but others are researching this form for different ideas. Here are some of the spots I like to hit up. http://www.PHPfreaks.com http://forums.mysql.com/ http://php.net Brett
  6. Well I used yours but I saw that teng84 did work fine. Thanks, Brett
  7. Ok after looking into this. I find that If 120 or 420 do not equal then they can continue. It seems to not work when I do this. if ($usrrights != "120" OR $usrrights != "420" ) { echo "You do not have access to this page!"; } else { Thank you, Brett
  8. Hello Everyone, I have some code and I am trying to have an OR statement to have a value equal 2 numbers. I cannot seem to get this to work. any help would be great if ($username == $username2 && $usrrights == 120 OR $usrrights == 420) { echo "You do not have access to this page!"; } else { Thank you, Brett
  9. Yes it does sound like PHP has this available to be used Here is the manual http://us3.php.net/reserved.variables Brett
  10. Try posting here. Beta Test Your Stuff! http://www.phpfreaks.com/forums/index.php/board,62.0.html This would be the spot that would help you do any testing. Brett
  11. Hello Everyone, I am working on a project and I would like to have only people that have the privilege to view the page. So what I did is added a UsrRights field to my database. And if a user has the permissions level of 120 they can view the page. I have made it an include to the pages that I want restricted. How can I make an if statement so if the rights are not equal to 120 that they get a error message? What do I add to the statement to continue to the page? include 'dbopen.php'; include 'dbconnect.php'; $username = $_COOKIE["user"]; $sql88 = "SELECT UsrRights FROM admin WHERE username = '$username'"; $query88 = mysql_query($sql88); $row88 = $query88; $formVars = array(); $formVars["UsrRights"]=$row88["UsrRights"]; //$secv = $formVars["UsrRights"]=$row88["UsrRights"]; echo $formVars["UsrRights"]; $secv = $formVars["UsrRights"]; if ( !isset($secv) != 120 ) { echo "You do not have access to this page." }else{ } Thank you, Brett
  12. I re-did the why I am using PHP and HTML. So it works for now. Thank you, Brett
  13. Can you be more specific on where I would add $row=mysql_num_rows($result); This would be over written by this line of code while ($row = mysql_fetch_assoc($result)) { Thank you, Brett
  14. Hello Guys, I am having issues with this drop down box look up from MYSQL. Here is the error Notice: Undefined variable: row in c:\web\www\app\addmember.php on line 58 Notice: Undefined variable: row in c:\web\www\app\addmember.php on line 59 these are the lines it errors out on while ($row = mysql_fetch_assoc($result)) { echo \"<option value=\"{$row['UserType']}</option>\"; <?PHP $sql = \"SELECT UserType FROM values \"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { echo \"<option value=\"{$row['UserType']}</option>\"; } } } ?> Thanks, Brett
  15. Hello Guys and Gals, Can this be done with this code. I want both fname and lname to be displayed in the drop down box. <? $sql = "SELECT fname, lname FROM admin ORDER BY `ID` DESC"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row['fname, lname']}\">{$row['fname, lname']}</option>"; } } } ?>
  16. I got it to work. I have SQl just add a default value if there is not a value. Thanks, Brett
  17. Incorrect integer value: '' for column 'AddressZip' at row 1 Brett
  18. Try this <? $sql = "SELECT * FROM table ORDER BY `ID` DESC"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row['Field from Table']}\">{$row['Field from Table']}</option>"; } } } ?> Brett
  19. Hello guys and girls, I am having issue with they way that my PHP MYSQL code works with the MYSQL version 5.0.45 Here is the Code that inserts the data into the database. The thing is the tables that have a int in MYSQl error when there is no value present. <?php } else { $FirstName = $_POST['FirstName']; $LastName = $_POST['LastName']; $AddressStreet = $_POST['AddressStreet']; $AddressCity = $_POST['AddressCity']; $AddressState = $_POST['AddressState']; $AddressZip = $_POST['AddressZip']; $CaseNotes1 = $_POST['CaseNotes1']; $CaseNotes2 = $_POST['CaseNotes2']; $CaseNotes3 = $_POST['CaseNotes3']; $CaseNotes4 = $_POST['CaseNotes4']; $OtherInfo = $_POST['OtherInfo']; $ServBy = $_POST['ServBy']; $Paid = $_POST['Paid']; $Amount = $_POST['Amount']; $ClientName = $_POST['ClientName']; $ServDate = $_POST['ServDate']; $County = $_POST['County']; $query33 = ("INSERT INTO `store` (FirstName, LastName, AddressStreet, AddressCity, AddressState, AddressZip, CaseNotes1, CaseNotes2, CaseNotes3, CaseNotes4, OtherInfo, ServBy, Paid, Amount, ClientName, County, ServDate) VALUES ('$FirstName', '$LastName', '$AddressStreet', '$AddressCity', '$AddressState', '$AddressZip', '$CaseNotes1', '$CaseNotes2', '$CaseNotes3', '$CaseNotes4', '$OtherInfo', '$ServBy', '$Paid', '$Amount', '$ClientName', '$County', '$ServDate')"); $insert_res = @mysql_query($query33) or die(mysql_error()); echo "Your Info Has Been Added "; } mysql_close($conn); ?> Database structure Field Type Collation Attributes Null Default AddressZip smallint(10) No What would make this happen. should I add that if there is no value present to make it 0? Thank you, Brett
  20. After a reinstall of the 3 goods AMP I have this working now. When people say your best just installing them all on their own. They are right. It works better then programs that have them packaged. (WAMP, PHPeasy) Thanks, Brett
  21. After looking in to it. It looks to me an issue with PHP5 and MYSQL5. I was able to get it to work fine with version 4 of both. If some one knows how to fix please advise. Thank you, Brett
×
×
  • 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.