Jump to content

mysty

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

Posts posted by mysty

  1. I have attached the code I insert to allow me to restrict access to the table between the code. In my user database I assign the level of access. That is, I assign a 9 to the admin and an 8 to everyone else.

    What I would like to be able to do is add some more access levels (ie 9, 8, 7, 6, etc) and then be able to restrict access to one of the tables to more than one access level. So, the code now allows only one access level, and I want to be able to allow more than one. How would the code need to be changed?

     

    <code>

     

    <?php if(isset($_SESSION['MM_UserGroup'])&& $_SESSION['MM_UserGroup']=='9'){?>

     

            TABLE In Webpage

     

    <?php } ?>

     

    </code>

  2. I have just discovered Dreamweaver's ability to use Spry, which uses javascript and Ajax, etc.  I need some help with a form that sends data to a MySQL database.  What I want to be able to do is have a validation-type alert if a user enters an email address and there is already that email address in the database.  Is this possible with Ajax?

    I don't really know much PHP and zero javascript or ajax.  Is this even possible?

    Might there even be a pre-made script I could use?

  3. I have just discovered Dreamweaver's ability to use Spry, which uses javascript and Ajax, etc.  I need some help with a form that sends data to a MySQL database.  What I want to be able to do is have a validation-type alert if a user enters an email address and there is already that email address in the database.  Is this possible with javascript, or do I have to use Ajax?

    I don't really know much PHP and zero javascript or ajax.  Is this even possible?

    Might there even be a pre-made script I could use?

  4. SELECT jobid, person, email, phone, company, position, city, state, description, 
    DATE_FORMAT(date, '%M %e, %Y') AS newdate
    FROM job_entry
    ORDER BY `date` DESC
    

     

    This is the entire recordset.  When I use it as-is, the date column is blank.

  5. Now that I have the dupe issue working well (see my other thread entitled "Help in displaying duplicates in database") I have discovered that I have over 3,200 duplicates.  Some with 2 and some with 3 or more.  What I would like to do now is to prevent the dupes from being entered.  So, is there a way (or what is the best way) to get a popup or error message that there is already a database row with the same firsname AND lastname entry?

  6. SELECT t1.*

    FROM tbl_data AS t1

    INNER JOIN (

    SELECT t2.lastname, t2.firstname, COUNT(*) AS cnt

    FROM tbl_data AS t2

    GROUP BY t2.lastname, t2.firstname

    HAVING cnt > 1 ) AS t2 ON ( t2.lastname = t1.lastname AND t2.firstname = t2.firstname)

     

    Fantastic!  This worked after I made one very small change - change a "t2" to "t1". 

    The last line should look like this:

    HAVING cnt > 1 ) AS t2 ON ( t2.lastname = t1.lastname AND t2.firstname = t1.firstname)

    Thanks so much.  This has really been a big help!

     

     

  7. Please disregard my last post (as I cannot edit it).  I  have done some work and am almost there.  Here is what I have now:

     

    SELECT *, COUNT(*)

    FROM tbl_data

    GROUP BY lastname, firstname

    HAVING count(*) > 1

     

    There is a slight problem.  This shows duplicate rows where the lastname and firstname are the same.  What I want is to display ALL dupes with the same first and last name.  For example, if my database contains 3 rows, all with the name of John Doe, the above query will only show one row that has John Doe.  I want all three rows to be displayed.  Any idea what needs to change?

  8. That is almost exactly what I want.  The latest shows the dupes, but shows each (lastname/firstname) dupe on only one row, with the lastname column filled with the recordid number(s).  If each dupe could be shown on its own row with the last name displayed, that would be absolutely perfect.

  9. I would like all the columns to be displayed because there is information in those other columns that I would like to consolidate manually. 

    I am not sure what "primary_keys" is in your script.  I used this variation of your script:

     

    SELECT GROUP_CONCAT(recordid) AS lastname, firstname, COUNT(CONCAT(lastname, firstname)) AS nbr_dups

    FROM tbl_data

    GROUP BY lastname, firstname

    HAVING nbr_dups > 1

    ORDER BY lastname, firstname

     

    I got a 2 column output that for each row, I got a first name and then sets of numbers, which I assume is the record number.  What changes do I need to make so all the columns are displayed for the dupes listed?

     

  10. I have a name & address database with 20,000 names that I would like to weed the duplicates from.  I have an admin menu that has a few ways to sort this database and would like to add a dupe check to this admin menu.  That is, I can sort the entries by last name, or by email address, etc.  What I  would like is to produce a list of dupes.  I will need to show dupes (only) by last name and then by first name.  I can also do this by showing only the dupes sorted on email address.  This is a bit over my head, so I need help with the query.  I am using PHP ver 5 and MySQL ver 5.

  11. When I created my DB, my hosting company (1and1) used MySQL 4.something.  Now, I would like to upgrade.  I created a new, smapll test DB and version 5 is apparently available, so I wanted to upgrade the old one to version 5.  How can I do that?

    I know how to export the DB and tables, is it a simple matter of exporting the tables, create the new DB, and then import the tables to the new DB?  I have over 14, 000 names and addresses I don't want to have to re-enter.  BTW, I am not upgrading just because.  Version 5 has some new things I would like to try and besides, I don't think version 4 is supported any more.

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