Jump to content

Shamrox

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Everything posted by Shamrox

  1. Well it was coming from album.php?catid=foliage So, can I use the GET to grab it from the URL? and then do what you showed above?
  2. I'm trying to change around a photo gallery so that the images are in a middle frame that is scrollable from left to right, the top frame would hold the navigation that would remain static and the bottom frame has the sitefooter. Ok, so, the way i have it now, I have a page that passes the variable in the url so that the proper gallery loads. See below. /album.php?catid=foliage The correct page would load with the proper images from the database. BUT, now i have this frameset, with a main title called album_set.php and the 3 frames called album_top.php, album_new.php (that's the middle for images), and album_btm.php What I can't figure out is how/where to pass the catid so that the middle frame file will load with the proper data. This is what i have now for the album_set.php file. <frameset rows="180,*,80" frameborder="no" border="0" framespacing="0"> <frame src="album_top.php" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" /> <frame src="album_new.php" name="mainFrame" id="mainFrame" title="mainFrame" /> <frame src="album_btm.php" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" /> </frameset> I've tried including all the php code and mysql query in various places in the different files, but none seem to work. Can anyone assist?
  3. I'm unsure what you mean by put into a hash
  4. I have this working query, but if it finds a duplicate number, I'd like it to continue looping thru until if finds a unique number. How would I alter this? $sql = "SELECT pin FROM `pin_users` ORDER BY pin ASC"; $results = mysql_query($sql); while($row = mysql_fetch_array($results, MYSQL_NUM)){ $data[] = $row[0]; $rando = rand(10000, 99999); } if (in_array($rando, $data)) { echo "Got Dup"; }else{ $rando; }
  5. Thanks, I'll give that a try.
  6. I have a database that contains users information including name, email, phone and PIN numbers. I need to send out an email to each user that would contain some standard text along with their PIN number. I'm not sure what method I should use or if it's even possible to have a system generated mass emailing occur and insure that each person only receives their own information. Can anyone assist?
  7. I've got a spreadsheet that has a few tabs with data in them. The first tab has suppliers listed with a name column and an ID column. All the other tabs, the person omitted the ID column and just has the name column with other data. I'm trying to put this into a mysql database and would like to have the ID on all the tables so it's easy to index. Any idea of how to do this aside from hand typing all the IDs on the other tabs before i import?!!?
  8. Thank you everyone for you help and suggestions. I finally got it working.
  9. Very good point about if a lot have been issued. Anyway around that?
  10. Added a bit more. Anyone think this is correct? <?php function checkPin() { $rando = rand(10000, 99999); $sql = "SELECT pin FROM `mfppins` ORDER BY pin ASC"; $results = mysql_query($sql); while($row = mysql_fetch_array($results, MYSQL_ASSOC)){ $ranpin[] = $row; } $found = false; for($x=0; $x<count($ranpin); $x++){ if($rando == $ranpin[$x]['pin']){ $found = true; checkPin(); }else{ return $rando; } } } ?>
  11. Ok, I started working on this bit of code to generate the number and then start checking to see if it exists. I need a bit of helping finishing it up. Basically, i create a number, query the database table to get all the existing numbers, then start checking to see if it matches the new random. not sure how to close the loop. <?php function checkPin() { $rando = rand(10000, 99999); $sql = "SELECT pin FROM `mfppins` ORDER BY pin ASC"; $results = mysql_query($sql); if(mysql_num_rows($results) > 0){ if $row['pin'] == $rando { }else{ return false; } }else{ $rando = rand(10000, 99999); return $rando; } } ?>
  12. Alright, I've gotten it all figured out how to generate a random 5 digit number between upper and lower limits. Now, what I can't figure out is how I go about finding out if that number has already been assigned in the database. These numbers are used as PINs for using a copier and I can't give out the same number twice. Any assist? Oh, and if it does find the number in the database, how do i make it look for a new unused one?
  13. Can you expand on that a bit? also, let me define a bit more. I will have a list of names that will most likely be in .csv format that i'd import into an empty mysql table. It is at this point that i'd want all the PINS assigned and autopopulated. Possible using your above method?
  14. I'm trying to create a table of user names and each one would have a random 5 digit number associated with it. Is there a way to create the mysql table and populate the names and have the numbers autogenerated randomly, just as if i used the standard auto generated numbering?
  15. possibly post some simple code that i could expand on and test?
  16. I had that method initially, but everytime the page loaded, it loaded blank and I couldn't figure out why
  17. I'm trying to improve the interactivity of a table of data. Currently, I have a column that displays an image and when clicked it takes the users to a form for emailing a reminder. Right next to that is a button that clears that record from the table when that reminder has been emailed. I'd like to make it so that the user only has to click on the first button/image and as it takes them to the email form page, it also updates the record in the database and would clear it from the table based on the status field being set to Yes. Currently here is my code, but it's not updating the database status field at all. Here is the code for the two columns. <td align="center" class="tabletext"><a href="email_form.php?form=reminderconfirmation&registrarid=<?php echo $row_rs_reminder['registrarid']; ?>"><img src="images/icon_reminder.jpg" alt="Reminder Agreement" width="18" height="20" border="0" align="center"></a> <div align="center"></div></td> <td align="center" class="tabletext"> <form id="clear" name="clear" method="post" action="<?php echo $editFormAction; ?>"> <button type="submit"><img src="/mdwapp/images/0090_check.gif" alt="Check" width="12" height="12" border="0"></button><input name="registrarid" type="hidden" value="<?php echo $row_rs_reminder['registrarid']; ?>" /><input name="clearstatus" type="hidden" value="Yes" /> </form> </td> Here is my code for submitting to database, but this doesn't do anything and not sure why. <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "clear")) { $updateSQL = sprintf("UPDATE spec_registrar SET clearstatus=%s WHERE registrarid=%s", GetSQLValueString($_POST['clearstatus'], "text"), GetSQLValueString($_POST['registrarid'], "int")); mysql_select_db($database_spectrum, $spectrum); $Result1 = mysql_query($updateSQL, $spectrum) or die(mysql_error()); $updateGoTo = "dashboard.php?page=reminder"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } ?> Can someone tell me how I'd put the two functions together and get it to update the status? Thanks.
  18. Here is what I came up with thus far. Doesn't seem to work right for output, but I think i'm headed in the right direction. any assistance is welcome. I've ommited some of the obvious page code that's not necessary to show... <form action="datetest2.php" method="post"> <select name="date" id="date"> <option value="DATE_SUB(CURDATE(), INTERVAL 1 MONTH)">Last Month</option> <option value="DATE_SUB(CURDATE(), INTERVAL 2 MONTH)">2 Month</option> </select> <input type="submit" name="button" id="button" value="Submit" /> </form> and then the output page $colname_rs_date = "-1"; if (isset($_GET['date'])) { $colname_rs_date = $_GET['date']; } mysql_select_db($database_spectrum, $spectrum); $query_rs_date = sprintf("SELECT registrarid, orderdate FROM spec_registrar WHERE orderdate = %s", GetSQLValueString($colname_rs_date, "date")); $rs_date = mysql_query($query_rs_date, $spectrum) or die(mysql_error()); $row_rs_date = mysql_fetch_assoc($rs_date); $totalRows_rs_date = mysql_num_rows($rs_date); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php do { ?> <?php echo $row_rs_date['registrarid']; ?> <?php echo $row_rs_date['orderdate']; ?><br /> <?php } while ($row_rs_date = mysql_fetch_assoc($rs_date)); ?></body> </html> <?php mysql_free_result($rs_date); ?>
  19. MySql, sorry for the ommision. So there are built in functions for this already?
  20. I'm trying to create a page for my enduser to build queries on the fly, and I'd like to have a dropdown that would have canned date selections like "Last week", "current month", "last month", "year to date", and "last year". They wouldn't have to pick any dates from a calendar, the code would figure this out. Ok, I'm not sure how to best accomplish this. Can anyone give me a hand?
  21. Here is what I changed the code to and when the page loads the orderdate field is blank. So, it's not working for a new blank record and putting today's date, and it's not working when i load an old record that already has the orderdate field populated. Any ideas? <input class="w8em format-m-d-y divider-slash highlight-days-12 range-low-today no-transparency" id="dp-normal-1" size="10" name="orderdate" type="text" value=" <?PHP if (empty($orderdate)){ echo date('m/d/Y') ; }else{ echo $orderdate; } ?>">
  22. I inherited the code from the last coder the client used. The code is full of those suppressants. Orderdate does exist as i checked via the database and also the current page that uses the old code. Not working, meaning, if i select a record that already has been saved with an orderdate, and i view it via the page that this code is in, that field doesn't get populated with the orderdate as it should. I will try your "empty" method and count my braces as well.
  23. I've got a simple text field that stores the order date. I'd like it to default to the current date, which is not a problem, but if I open a record that already has a date in the database, I need that to show. I tried to alter my code as seen below, but it's not working right. Can someone help? Order Date <input class="w8em format-m-d-y divider-slash highlight-days-12 range-low-today no-transparency" id="dp-normal-1" size="10" name="orderdate" type="text" value=" <?PHP if (@$orderdate == ""){ echo date('m/d/Y') ; }else{ echo @$orderdate; } } ?>">
×
×
  • 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.