Jump to content

Shamrox

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Shamrox's Achievements

Member

Member (2/5)

0

Reputation

  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?
×
×
  • 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.