Database advice

Hi,
I know database questions have been asked quite often here
and I've
searched through previous posts and found some valuable info.
But just
wanted some extra advice.
I'm building an aplication that's made of parts. First, you
have the
database management program. This is relaltively simple -
just names of
people with related data for each person. The user can open
this
application, choose a person and change his/her info. The
user can also
add a new person. The information needs to be saved. I was
thinking this
is easy enough to do with Director and saving to an external
text file.
My second application displays a person and his/her info on
screen and
reads this info from the external text file. This application
is a
Director file. These are both done offline.
So, my question is what adivce do you have on this? Should I
just stick
with a text file. Should I make it a database? If I go with a
database,
what's the most simple one to use?
Thanks.

Most of the database xtras come with a database management
program. For
instance, I know that both Valentina and Arca have dedicated
programs to
adding, changing, and otherwise manipulating the data in the
database.
If you don't want that, it is pretty easy to write such a
thing, since
all the database xtras have Lingo functions to read and write
to the
database, so you can make a simple program that is just an
interface for
changing things.
Making the other part of the program to just display stuff
from the
database is even easier.
It may be easier (and definitely cheaper) to not use a
database per se,
instead just use Lingo lists. It depends on the quantity and
types of
the data. If you just need it to store name, address, phone
number, and
photo of <1000 people, and the photo portion can be an
external image,
then a Lingo list is the way to go. I just made that 1000
number up,
there is not real cutoff, but after a list gets real big, it
can get
difficult to manage. I have heard of folks using 10000 item
lists
without problems.
You can make a program that manipulates the list pretty
easily using the
Lingo commands setAProp, addProp, and deleteProp (check the
help files
for more details on those commands)
gPersonInfo=[:]
gPersonInfo.setAProp(#mike,[#email:"[email protected]",#photo:"mike.jpg",#phoneNumber:" 999-999-9999"])
put gPersonInfo[#mike]
-- [#email: "[email protected]", #photo: "mike.jpg",
#phoneNumber:
"999-999-9999"]
put gPersonInfo[#mike][#email]
-- "[email protected]"
In this case, I only have info about 1 person. But you can
use setAProp
to set info about as many fols as you want. And if all of the
photos
are in for instance, a folder called "photos" under the
folder that the
Director project is in, you could use a command like this on
a bitmap
sprite to display it *this one is Windows only, if you needed
it to be
Mac compatible, then make sure you can use Mac foldername
converntions,
(i.e. colon as folder delimiter instead of the backslash):
global gPersonInfo
on changePhoto me, vPerson
thisPersonPhoto=gPersonPhoto[vPerson][#photo]
sprite(me.spriteNum).member.filename=the
moviePath&"images/"&thisPersonPhoto
end
That function will cause the photo to change if you send it a
command
like this:
sendAllSprites(#changePhoto,#mike)
As far as saving the database to a file, there are loads of
xtras that
can do it, the best ones, I think is propSave (which is free)
or vList.
In fact, now that I think of it, I believe that both of them
can save
image data into a list, so you may not even need to keep the
images as
external...

Similar Messages

  • Front End to Oracle Database - Advice Needed

    Hi
    My company has recently purchased an Oracle Database. Are there any advantages in creating the front end in Oracle as opposed to writing the front end in Java.
    I am interested to know if one method is preferred over the other. I was planning on writing it entirely in Java.
    Any help or advice would be appreciated.
    Thanks
    Kelly

    http://www.tuxedo.org/~esr/faqs/smart-questions.html#ASKING
    pls don't crosspost
    http://forums.java.sun.com/thread.jsp?thread=243868&forum=31&message=892346
    http://forums.java.sun.com/thread.jsp?thread=243869&forum=48&message=892352

  • Reporting database advice needed

    I need some advice from you folks that have been doing this a long time.
    I've implemented a reporting database using materialized views. It runs on HPUX 11.23, using Oracle 10.2.0.2.Bottom line is that the performance on it is HORRIBLE. I'm talking on a scale of 1 to 10, it's a 1.
    Are there any other options to doing a reporting database that updates nightly from the production database?
    I'm getting hit hard to get this thing up and functional. But it's so poor, that people won't use it. I've run the sql through the tuner, and it comes back good. Is there some other way of looking into this thing to see where the brick wall is?
    I had thought about using a standby database, running in read only mode. But I learned that once brought online in read only mode, it doesn't update the logs anymore. I guess I could run some nightly scripts to bring it back off line and into recovery mode to update all the logs, then return to read only?
    Is there better options out there? I'm at a loss at this point.
    Thanks.

    Being that the bad performance is coming off a different server, if I understand the environment, have your compared the hardware capability including cpu, memory, and disk?
    What kind of disk do you have, is it stripped, etc ...?
    Are both databases using the same version of Oracle?
    Are both databases running on the same OS and version?
    What do the OS level IO, memory, and cpu statistics look like?
    What kind of network connection do you have between the two machines? Has anyone verified that the network card is set to full duplex? Has anyone even looked at the network for this situation?
    HTH -- Mark D Powell --
    PS - Is the second server physical or virtual? There are a lot of things that can impact performance. You have not provided much in the way of what the environment looks like. Reviewing the answers to the above questions may allow you to spot the problem.
    Edited by: MarkDPowell on May 8, 2009 5:02 PM Add PS

  • Universe based on Unidata database advice

    Hi there,
    I am looking for advice to building a universe based on a unidata database
    What is the best way to connecct to the datbase?
    Will I end up building lots of derived tables with loads of  UNION statements?
    Are there any tools out there to create a view that Business Objects can use?
    regards
    James

    .

  • Database advice needed

    Since I have no knowledge of databases, I'm turning to my fellow Arch users for advice.  I would like to have a collection of quotes.  I don't believe something as simple as fortune text files would be sufficient, because I would like to have the ability to add meta information which classifies the subject or nature of a quote:  tagging the moral of one of Aesop's fables as 'moral' or tagging a quote from Jefferson as 'personal liberty' to signify the subject of the quote.  A database, as far as I know, will help simplify the maintenance and access to this collection.  As for future plans, I may use this database to put a quote on my website.  So my problem is that I don't know where to go from here.  A simple interface is preferred but not necessary.  As for integrating the database with my website, my hosting environment is the math department at Kansas State University.  Thus my host will change when I change schools.  Any suggestions or criticisms of my plans are welcome.

    ok poet... here's a quick breakdown:
    sqlite (mentioned twice) is rather interesting.  It's self contained, meaning you don't need a seperate daemon running to retrieve the data (check out trac, it uses sqlite exclusively for all it's wiki data).  There are also numerous sqlite language extensions (pysqlite is in my repo + AUR)
    mysql most likely outperforms sqlite, however it requires a decent chunk of db knowledge, and runs a seperate daemon...
    alot of people love mysql, but me, not being a web developer, would spring for sqlite instead.

  • Impdp full database advice

    I need to impdp from a full expdp dump. There will be 5 11g exp dmp.
    I want to be sure before I do the import the following steps are right:
    1). drop users cascaed; (to drop all the users except sys/system)
    2). using impdp to import the exp dump files.
    Anything else I need to do ?
    Thank you .

    Pl post exact OS and database versions, along with the complete expdp command used. You will need to ensure that the target database has the same characterset (or a superset characterset like AL32UTF8). Pre-create the tablespaces if the target database has a different file layout than the source.
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm#i1007653
    HTH
    Srini

  • Back pressure due to version buckets: Exchange 2013

    Hi,
    My setup is Exchange 2013 CU5 on Server 2012 fully patched running on vmware 5.1 fully patched. The server supports around 50 users, has 16GB of memory, a 16GB page file and fast disk access to dedicated disks on a SAN. My vmware host has 96GB of memory
    and around half is in use.
    A few times today we got MSExchangeTransport warnings about resource pressure relating to 'version buckets' around the same time someone sends a large attachment (around 40MB). We have generous sending limits at 50MB due to the nature of our work.
    The full message is...
    The resource pressure increased from Normal to High.
    The following resources are under pressure:
    Version buckets = 330 [High] [Normal=80 Medium=120 High=200]
    Physical memory load = 93% [limit is 94% to start dehydrating messages.]
    The following components are disabled due to back pressure:
    Inbound mail submission from Hub Transport servers
    Inbound mail submission from the Internet
    Mail submission from Pickup directory
    Mail submission from Replay directory
    Mail submission from Mailbox server
    Mail delivery to remote domains
    Content aggregation
    Mail resubmission from the Message Resubmission component.
    Mail resubmission from the Shadow Redundancy Component
    The following resources are in normal state:
    Queue database and disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\mail.que") = 58% [Normal] [Normal=95% Medium=97% High=99%]
    Queue database logging disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue\") = 58% [Normal] [Normal=95% Medium=97% High=99%]
    Private bytes = 4% [Normal] [Normal=71% Medium=73% High=75%]
    Submission Queue = 0 [Normal] [Normal=2000 Medium=4000 High=10000]
    Temporary Storage disk space ("C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp") = 58% [Normal] [Normal=95% Medium=97% High=99%]
    Task Manager shows memory usage at 90% (14.4GB of 16GB)
    We recently migrated from Exchange 2010 (with 8GB memory) and had no issues with back pressure.
    I ran get-messagetrackinglog to cover a few minutes either side of this event being logged. There were around 150 entries. A single email was over 40MB in size. There were also multiple lines showing the same email, which does not reflect in the users mailboxes
    (for example a single autoreply was sent from one user, but the get-messagetrackinglog showed 11 results). I have posted a question about this here also...
    https://social.technet.microsoft.com/Forums/en-US/6425aa7a-4957-487e-ad7c-6aec5fe50379/getmessagetrackinglog-multiple-results-for-single-email?forum=exchangesvradmin
    If a single large email caused the back pressure to kick in how can I prevent this happening in future? I don't want to simply limit my attachment size (as mentioned this was fine on Exchange 2010 and 2003 before that)
    I checked EdgeTransport.exe.config and noted the following default entries
    <add key="DatabaseMaxCacheSize" value="512MB" />
    <add key="DatabaseCheckPointDepthMax" value="384MB" />
    <add key="QueueDatabaseLoggingBufferSize" value="5MB" />
    Would increasing these help?
    Lastly, I have read this article (http://eightwone.com/2011/04/06/limiting-exchange-2010-sp1-database-cache/) and wondered whether it would be beneficial to implement a limit on the database cache? If so, what should I be aiming at for my setup? And is this
    relevant for Exchange 2013? (I don't see a performance counter for Database Cache Size Min, or Max under 'MSxchange Database')
    Advice greatly appreciated.

    Found this in a different Exchange forum; worth reading.  This thread was marked as answered.  Good luck.
    https://social.technet.microsoft.com/Forums/en-US/c3d300c5-473f-4ab3-8df2-e85c0ea2ed99/backpressure-activated-after-exchange-cu5-installversion-buckets?forum=exchangesvrsecuremessaging

  • How can I create an EntityStore for a Database?  Advice on DB strategy?

    Hello All,
    How can I create an com.sleepycat.persist.EntityStore for a com.sleepycat.db.Database? Advice on DB strategy?
    I'm looking to create an application prototype that creates a database dynamically and can delete it programatically. Is openDatabase/removeDatabase what I'd want to use for that?
    So far, the Direct Persistence Layer is an amazing piece of technology and has the potential to make my team's application faster than we every though possible, so kudos to the author.
    I've built a high-security application using the DPL and a single database for hundreds millions of users. I'd like to attempt to create a database for each user for security and manageability purposes. Our mission statement doesn't allow us to execute queries for sensitive data across more than one user account at a time, so I don't get any benefit from having every user's objects in a single database. I'm investigating if giving each user their own database will speed up insert times and SecondaryIndex queries. It'll certainly be more secure as each database will be encrypted with a unique password.
    My design is that I have an app with dozens of com.sleepycat.persist.model.Entity beans which I persist and query on their Primary and secondary indexes. I've been accessing things through an EntityStore as illustrated in the Getting Started Guide. Can I access a database created with openDatabase through an EntityStore and com.sleepycat.persist.PrimaryIndex?
    Thanks in Advance,
    Steven
    Harvard Childrens Hospital Informatics Program

    I closed this as I found another way to solve my issue.
    Thanks,
    Steven

  • Advice needed regarding Database design practice

    OK, here is my situation. I've started working for a company about 6 months ago. I'm a .NET developer with 12+ years of experience. Most of my experience with databases is with SQL Server. Recently I've discovered an design change with our Oracle database that our DBA made that I completely disagree with.
    We had a single Event table that holds records that pertain to all HTTP traffic on a network as HTTP Usage Event. There are multiple hardware units called 'Sensors' that monitor the network and report these HTTP events to the database. At some point not long ago, the table was holding just over a million records. Performance was suffering so the DBA decided to make a change to the database to accommodate. The change she made was to create a separate Event table for each sensor. Each sensor has an integer value as a unique identifier, so our database went from having a single Event table to now having Event_100, Event_101, Event_102, etc...
    So, we now have over 200 Event tables in our database. Anytime a sensor is added to the system, we need to add another table (actually two as there is a 2nd table that was duplicated in this same fashion).
    How do I present this to my boss and to the DBA in a way that I don't embarrass my boss (he approved the change) and without pissing off the DBA? I can't imagine that the table couldn't have been optimized as it was to take care of the issues with performance without so dramatic a change.
    Any advice would be greatly appreciated.
    Edited by: jreddy on Dec 15, 2010 6:51 AM

    There is a job to purge old data. Events are kept for 3 months. These jobs were actually part of the problem, as well as removing sensors from the system. In either of these cases, the deletion of the data (more so with the removal of a Sensor i.e. DELETE FROM EVENT WHERE SENSORID = X, was taking too long).
    I'm surprised that there have been people agreeing to this design. So, now we have 208 sensors, so 208 Event tables and another table named DATA_HASH duplicated 208 times. There may be a time when our database will be handling data from over 1,000 sensor units. Maybe even double that. Can anyone argue that having 2,000 event tables is the way to go? What if we need to add a new field to the table? Do that 2000 times?
    I've been looking at bit more at the data today. I found some event tables haven't got any data (0 rows) while others range in row counts of 2 million up to as much as 30 million? I've talked to SQL DBA's and they all think that Oracle should be able to handle billions of rows in a table.
    Also, just out of curiosity, I looked up the max size for a table in Oracle 10. I know the number of rows isn't the determining factor for this, but size of the data. I was astounded to find out the max size for data storage for a single table. 127 TB (yeah, tera bytes). Based on this size, it seems our data could be handled by 1 table, but then maybe I'm wrong.

  • Time-series / temporal database - design advice for DWH/OLAP???

    I am in front of task to design some DWH as effectively as it can be - for time series data analysis - are there some special design advices or best practices available? Or can the ordinary DWH/OLAP design concepts be used? I ask this - because I have seen the term 'time series database' in academia literature (but without further references) and also - I have heard the term 'temporal database' (as far as I have heard - it is not just a matter for logging of data changes etc.)
    So - it would be very nice if some can give me some hints about this type design problems?

    Hi Frank,
    Thanks for that - after 8 years of working with Oracle Forms and afterwards the same again with ADF, I still find it hard sometimes when using ADF to understand the best approach to a particular problem - there is so many different ways of doing things/where to put the code/how to call it etc... ! Things seemed so much simplier back in the Forms days !
    Chandra - thanks for the information but this doesn't suit my requirements - I originally went down that path thinking/expecting it to be the holy grail but ran into all sorts of problems as it means that the dates are always being converted into users timezone regardless of whether or not they are creating the transaction or viewing an earlier one. I need the correct "date" to be stored in the database when a user creates/updates a record (for example in California) and this needs to be preserved for other users in different timezones. For example, when a management user in London views that record, the date has got to remain the date that the user entered, and not what the date was in London at the time (eg user entered 14th Feb (23:00) - when London user views it, it must still say 14th Feb even though it was the 15th in London at the time). Global settings like you are using in the adf-config file made this difficult. This is why I went back to stripping all timezone settings back out of the ADF application and relied on database session timezones instead - and when displaying a default date to the user, use the timestamp from the database to ensure the users "date" is displayed.
    Cheers,
    Brent

  • Advices for database application

    hello,
    We looked for exising solution to manage mesuremens and devices park without finding one that fit
    maybe one of you know/use a good one !
    so we are thinking about creating our own
    in few month  i will have to develop a database application with postgre, this database will be used
    to store devices mesurements, accuracy, drift , create alerts regarding calibration date,
    printing calibration , verification certificates also stickers ....
    Creating the dabase sould be ok, my question  is more regarding the langage to use to create interfaces
    things to know:
    - that i will not have any specifications or so few, this will be incrementals propositions
    - I ' now quite comfortable with labview        
    - php it surely the best way but i don't know any about it nether html ,css ...
    - i could have a one week php course
    - php is distributed application
    - how to manage network shutdown with labview or php
    - i will need to access an existing database an creating link with the new one 
    - about 10 users can use the application 
    - i don't have conection with web developper in my work circle
    project is interesting , my anxiety with php could be to re write again and again , each time i will progress on this language
    with labview i'm not sure that is the best way to create this type of application and to be forced a day or another to switch to php
    If any advices don't hesitate
    Tinnitus
    CLAD / Labview 2011, Win Xp
    Mission d'une semaine- à plusieurs mois laissez moi un MP...
    RP et Midi-pyrénées .Km+++ si possibilité de télétravail
    Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
    Don't forget to valid a good answer / pensez à valider une réponse correcte

    I have been doing something like this for a while. I really do not like php but in all fairness I have not looked at it for several years. What I use is Python on the server through the Django web application framework running on Apache. It is very simple and easy to use.
    The LabVIEW code writes data through http POST requests and the server inserts this data into the database. I do not use the Django object relational mapper. Instead I build the SQL inserts manually. I do this mostly because the database already exists and I just find it more natural.
    I also do not make use of the Django template engine. The server returns XML to LabVIEW which looks something like this:
    <Response>
     <Error>
      <Cluster>
       <Name>error in (no error)</Name>
       <NumElts>3</NumElts>
       <Boolean>
        <Name>status</Name>
        <Val>0</Val>
       </Boolean>
       <I32>
        <Name>code</Name>
        <Val>0</Val>
       </I32>
       <String>
        <Name>source</Name>
        <Val></Val>
       </String>
      </Cluster>
     </Error>
     <Data>
      <Cluster>
       <Name>Hello from server</Name>
       <NumElts>3</NumElts>
       <String>
        <Name>String</Name>
        <Val>Hello</Val>
       </String>
       <Boolean>
        <Name>Boolean</Name>
        <Val>1</Val>
       </Boolean>
       <DBL>
        <Name>Numeric</Name>
        <Val>42.00000000000000</Val>
       </DBL>
      </Cluster>
     </Data>
    </Response>
    Can you see what I am doing? I am returning an error and a cluster which can be unflattened using Unflatten From XML. I can set LabVIEW errors from Python for things like a request without the required parameters or whatever. I have a Python class that builds the XML Response which contains exactly two children - Error and Data. It has methods including createCluster, addLVObject, createLVArray, insertLVArrayElement, setError, etc. Finally it has a getXMLResponse method which returns the above XML string.
    I return that using the Django HTTPResponse object and get at the data in LabVIEW like this
    The returned cluster can be as complex as you want such as cluster of cluster of array of cluster. It always returns a cluster so if you want the server to return say an array then you will get a cluster containing an array that you simply unbundle. It supports strings, all the numeric representations, paths, visa resources, boolean and something i am forgetting at the moment.
    Also my URL configuration is very simple since I only POST and do not send GET requests. This means I can map the URL directly to the Django view method of the same name. I get the parameters with request.POST.get('Parameter Name')
    I know for a fact that you can do all of this with php but I just prefer Python. If none of the above makes sense then come back to it after you read about Django.
    Good choice if it was a choice to use PostgreSQL or a stroke of good luck if it was not a choice. This is what I use and it has been rock solid for years. I really want to upgrade because the NOTIFY now supports data payloads. I have had to do some crazy things to get around the fact that the older versions do not support this.
    I am thinking seriously about putting together a tutorial on this whole thing.
    =====================
    LabVIEW 2012

  • Need advice on what kind of report, queries to tune database slow issues

    Currently we have AWR reports. Our system is 11.1.07 version on AIX/Linux.
    Sometimes application will say it is slow running some queries.
    We have firewalls implemented so we cannot use toad, or other tools to access through our workstation.
    Any good manual suggestions to pinpoint what exact wrong in the system?
    Any good suggestions?
    Thanks in advance.

    846422 wrote:
    Any good suggestions?
    Try to forget for a moment the nice GUI tools and read instead what experts do when trying to answer "Why my database is slow ?" in http://www.nocoug.org/Journal/NoCOUG_Journal_201105.pdf.
    In your case I would try to work with end users to identify application scenarios that are slow and use SQL trace/TKPROF on related database sessions. For this you only need command line interface (CLI) access to run SQL statements and access to machine hosting database server: that should be possible with the jump server otherwise you cannot do anything and you would better ask someone that has CLI access to database and database server machine.
    If you have license to use AWR, you can also use ADDM report which runs an automatic analysis of AWR report and give some advices:
    SQL> @?/rdbms/admin/addmrptEdited by: P. Forstmann on 22 juil. 2011 20:15
    Edited by: P. Forstmann on 22 juil. 2011 20:40

  • Advice me regarding the certification path for 10g database certification.

    Hello friends,
    I am planning to take the certification for Oracle 10g database Associate, and am confused about the codes of the tests I need to take.
    I have following queries:-
    1) Is it enough to take 1Z0-042, to take Oracle Certified Associate, certification?
    2) Is it necessary to take 1Z0-047 as a support for this certification?
    3) Would I be considered for job openings if I get certified? (I mean the frequency of jobs). I know it is hard to answer this question, however I want an idea of applying for certified related jobs that accept OCA.
    Please advice me in this regard.
    Thanks in advance
    Murli

    Please post any other certification-related questions in the forum: Oracle Certification Program
    To become OCA you need to do the 1z0-042 exam and one of the following exams: 1z0-007, 1z0-051, 1z0-047.
    Becoming certified will put you in front of many people, but what employers are mostly looking for is experience. Many companies require a certification for the person to be even eligible for the interview, others use it as a differential.

  • Require technical advice for designing XML database

    Dear Fellows
    I need your technical advice for the way storing the XML files into the database. We have experiments that produces more than 300 XML files. I want to store them in the database. There should be a mechanism (way) to store XML files related to one experiments. I can not change or update anything in the XML files to put something like counter or anything.
    Can you please advice me or give any hint that how should i store experiments with their XML files with their unique key. Another thing when i have new experiment XML files to store how to store them
    any help and any hint will help in a great manner
    regards
    Imran Sabir

    Google http://www.oradev.com/xml.jsp
    http://articles.techrepublic.com.com/5100-22-5075453.html

  • Can anyone give me some advice on databases?

    Hi All,
    Ive recently created my first database in phpmyadmin so i am new to the whole process. Id like to some how apply a time limit of 60 days to the data that is uploaded to the table, after this time id like the data to be automatically deleted. Is this possible in phpmyadmin and can this be done without changing or making alterations to the code in Dreamweaver? Please see image below to see the structure of my database table.
    Thank you for any advice!

    Ok i have done that and inserted a new data via my 'insert_donations.php' page which has uploaded the new data and a date now appears in 'dateCreated' column in my table, all working as it should! I tried changing the date to yesterdays date via phpmyadmin but it didnt seem to like it so ive left it and will wait to see if it deletes it tomorrow. Fingers crossed! BUT the problem i am having now is when i open the 'insert_donations.php' the security login page (index.php) should load first but now it doesn't for some reason. It was working great until i added that earlier code (above)?
    Heres what the code looks like -
    <?php require_once('../Connections/milesdata.php'); ?>
    <?php
    $con=mysqli_connect("localhost","root","root","milesdata");
    // Check connection
    if (mysqli_connect_errno())
       echo "Failed to connect to MySQL: " . mysqli_connect_error();
    mysqli_query($con,"DELETE FROM donations WHERE date < DATE_SUB(NOW(), INTERVAL 1 DAY");
    mysqli_close($con);
    ?>
    <?php
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && true) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "index.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO donation (name, url) VALUES (%s, %s)",
                           GetSQLValueString($_POST['name'], "text"),
                           GetSQLValueString($_POST['url'], "text"));
      mysql_select_db($database_milesdata, $milesdata);
      $Result1 = mysql_query($insertSQL, $milesdata) or die(mysql_error());
      $insertGoTo = "insert_success.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>
    <!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>Insert data</title>
    <style type="text/css">
    @import url("../Style sheet.css");
    a:link {
              color: #D91327;
    a:visited {
              color: #D91327;
    a:hover {
              color: #CEB239;
    a:active {
              color: #D91327;
    </style>
    </head>
    <body>
    <div id="container"><img src="../banner.jpg" width="1082" height="187" alt="banner" />
    <p> </p>
    <p class="admin_heading">Insert Record to Database</p>
    <p> </p>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <table align="center">
        <tr valign="baseline">
          <td height="25" align="right" nowrap="nowrap" bgcolor="#E6CC7F">Deceased Name:</td>
          <td height="25" bgcolor="#E6CC7F"><input type="text" name="name" value="" size="70" /></td>
        </tr>
        <tr valign="baseline">
          <td height="25" align="right" nowrap="nowrap" bgcolor="#F5E7B8">Deceased Unique Url:</td>
          <td height="25" bgcolor="#F5E7B8"><input type="text" name="url" value="" size="70" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right"> </td>
          <td><input type="submit" class="submit" value="Insert record" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p> </p>
    <p class="maintext">If you wish to just update data in database please click <a href="update_donation.php">here</a></p>
    </div>
    </body>
    </html>

Maybe you are looking for