Display all database results with URL variable?

Hi,
I am using PHP MySQL
I have a database that is Alphabetically ordered. I am trying to create a dynamic page that will only show A, B, C, ... and so on. I do this by Creating links named after the letters in the Alphabet. I have a recordset that filters the table using a URL variable that uses Type. Unfortunately when I click on the link it only displays the first record that contains an A. Not all the records that contain  A.
For example:
I have a link that is just "A". Its link is ?Type=A. In the database table their are 3 records that contain A under Type, but when I click on it only one record containing A is displayed. I hope you are following this.
If you want a direct reference to what I am doing go to:
http://cwhazzoo.com/gamelinktesting.php
This is how my database is designed:
ID (primary key)
Name
Letter
0001
Example A
A
I want to be able to show only the selected letter of records using only one page. Thanks!

>Should I use the repeat region?
Yep. That's what it's for.

Similar Messages

  • Slow Query over Database Link with Bind Variable

    I have a query over a DB link, with all tables on the remote database.
    If I use a bind variable (from Toad), the query takes 4 minutes. If I replace the bind variable with a constant or substitution variable, it takes 1 second.
    The query runs fine when run directly on the remote database using bind variable.
    9.2.0.7

    Look up "Bind variable peeking"
    What's happened is you have an execution plan that differs from the one with the constant. Why? My bet is that Oracle "peeked" at the bind variable to help it decide which execution plan to build. It then cached it. It probably cached an execution with an index when it should be doing a full table scan or a hash join instead of a nested loop. It's hard to say specifically what it is.
    Try this, flush your shared pool and rerun the query with the bind and let us know if it takes 1 second or 4 minutes. If it takes 1 second, then that was probably it.
    Read part 2 of Tom Kyte's blog post on what it is and it's behavior.
    http://tkyte.blogspot.com/2007/09/sqltracetrue-part-two.html

  • SSRS - How to display all the results from a query and then be able to filter the data

    Let's say I have a simple query that will return products name, ID, price
    SELECT pname,
    pID,
    price
    FROM products
    When I display the results in SSRS the user will (without entering any parameters) see something like:
    Product Name | ID | Price
    xyz                    1     $10.00
    .zzz                    10   $4,000.00
    How can I filter my results once they are displayed? For instance, Out of the results the user wants to see only the products where price is between $10 and $3000?
    -Alan

    Hi Visahk,
    Maybe I did not explain my issue very good. 
    I want the user to first see all results (without entering the price range) - then if he wants she/he can filter the results by price.
    As soon as I add 
    WHERE price BETWEEN @StartPrice AND @EndPrice
    to my SQL query, the user is prompted to enter a price range before seeing any data.
    -Alan
    Ok for that what you can do is to set allow null value property for the parameters.
    Then set NULL as default value for parameters in parameter properties tab
    and make the query as below
    WHERE price BETWEEN @StartPrice AND @EndPrice
    OR (@StartPrice IS NULL AND @EndPrice IS NULL)
    and then report will get executed without waiting for any prompt and user may change values at a later stage and rerun it
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Display query's result (with many rows & field) into a list ?

    I'd like to display the result of a query wich returs many rows without using a list of values but another component which allowed the display of sereval columns at the same time.
    Note: I can't use a LOV because I don't want to return no value, and I need a TLIST presentation.
    null

    A kludgy solution would be to create a database view that combines the multiple columns into a single standardly formatted column, and use that for displaying in a jcombobox.
    Depends upon whether you like to code Java or like to play in the database. grin
    If you do that Java solution please post the code here!

  • Dynamically automating all database backups with known filenames.

    I need to know the name of the full database backup, so I can restore to another server. I came up with this basic script for backing up (script 1) but I want to do this dynamically, and began to play with cursors, which did not go so well. The second script
    seems to create an infinite loop or some nasty Cartesian. If anyone can point me in a direction to getting my peanut butter to mix with my chocolate I'd appreciate it.
    FWIW, the end goals are to know the db name and do this in a dynamic way so anytime a db is dropped or added we do not have to remember to update backup jobs. Up till now maintenance plans worked, but now we want to know the backup name so we can restore
    db's to a preprod environment. Any suggestions/guidance/links would be appreciated.
    declare @dbname varchar(100)
    declare @backupdate varchar(25)
    SET @backupdate = convert(varchar(25), GETDATE(), 112)
    declare @backupfilename varchar(150)
    declare @backupSQL varchar(MAX)
    Set @dbname = 'master'
    Set @backupfilename = @dbname + @backupdate + '.bak'
    SET @backupSQL = 'BACKUP DATABASE '+@dbname+' TO DISK = N''\\delos\SQL_Live_Backup\PreProd_BackupRestore\'+@backupfilename+'''
    WITH FORMAT, INIT, NAME = N'''+@backupfilename+''', SKIP, NOREWIND, NOUNLOAD, STATS = 10, CHECKSUM, CONTINUE_AFTER_ERROR'
    EXEC(@backupSQL)
    declare @dbname varchar(100)
    declare @backupdate varchar(25)
    SET @backupdate = convert(varchar(25), GETDATE(), 112)
    declare @backupfilename varchar(150)
    DECLARE db_cursor CURSOR
    FOR SELECT name FROM sys.databases WHERE NAME NOT LIKE 'zz_%' AND [state]=0 AND is_read_only=0 AND user_access in (0,1)
    OPEN db_cursor
    FETCH NEXT FROM db_cursor
    INTO @dbname
    WHILE @@FETCH_STATUS = 0
    BEGIN
    PRINT @dbname + @backupdate + '.bak'
    END
    CLOSE db_cursor;
    DEALLOCATE db_cursor;

    I keep the names of the databases need to be backup in the separate table and then run the query.
    This create creates a folder (name of the database)  and keeps the files for 6 days old IIRW.
    CREATE PROCEDURE [dbo].[sp_DatabasesToBackup1] @LocalBackupPath AS VARCHAR(8000)
    AS
    DECLARE @name AS SYSNAME
    DECLARE @CommandString AS VARCHAR(8000)
    DECLARE @SQL AS VARCHAR(8000)
    DECLARE  @FS SMALLINT
    SET NOCOUNT ON
    CREATE TABLE #t(dbname VARCHAR(8000))
    BEGIN TRY
    ;WITH cte
    AS
    SELECT  [name],ROW_NUMBER() OVER (ORDER BY name) rn
    FROM sysdatabases INNER JOIN
    DatabasesToBackup ON
    sysdatabases.dbid = DatabasesToBackup.dbid
    WHERE  DATABASEPROPERTYEX ( [name] , 'status' )='ONLINE'
    ) INSERT INTO #t SELECT [name] FROM cte 
    ORDER BY rn
    DECLARE sysdatabasesCursor CURSOR FOR
    SELECT dbname FROM #t
    OPEN sysdatabasesCursor
    FETCH NEXT FROM sysdatabasesCursor
    INTO @name
    SELECT  @FS =  @@FETCH_STATUS
    WHILE (@FS <>-1)-- 0 ---=<>-1
    BEGIN
      PRINT 'Start Backup ' + @name + ' database. '
      SET @CommandString = 'IF NOT EXIST "' + @LocalBackupPath + '\' + @name + '" MD "' + @LocalBackupPath + '\' + @name + '"'
      EXEC xp_cmdshell @CommandString
      PRINT 'Create Local Dirctory Complete.'
      SET @SQL = 'BACKUP DATABASE [' + @name + '] TO DISK = N''' + @LocalBackupPath + '\' + @name + '\' + @name + CONVERT(VARCHAR, GETDATE(), 112) + '.bak'' WITH INIT, NOUNLOAD, NAME = N''' + @name + ' backup'', SKIP, STATS = 10, NOFORMAT'
      EXEC(@SQL)
      FETCH NEXT FROM sysdatabasesCursor INTO @name
      SELECT @FS =  @@FETCH_STATUS
      SELECT @@FETCH_STATUS  AS '@@FETCH_STATUS'
      SELECT @FS AS '@FS'
    END
    CLOSE sysdatabasesCursor
    DEALLOCATE sysdatabasesCursor
    END TRY
    BEGIN CATCH
           SELECT ERROR_MESSAGE()
           ---INSERT INTO Errors(ERRMSG,CommandString) SELECT ERROR_MESSAGE(),@CommandString
    END CATCH;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Linking to Movie Frames with URL Variables

    Is there a way to link directly to a specific keyframe of a
    SWF using code in the URL? We have build a Flash portfolio
    slideshow for a number of artists and we would like to link to the
    main page for each artist within the main movie. So the URL might
    look something like this
    http://mysite.com?artist=joebob.
    As an example, we would want this URL to point to Joe Bob's
    portfolio page instead of the home page for mysite.com. Joe Bob's
    page would be on the 200th frame of the main movie, for
    example.

    Linky

  • Powershell script to get a LIST OF ALL SITES ALONG WITH URL from a web application where we gave access to EVERYONE AD GROUP

    Hi,
    Any help on this?
    Thanks
    srabon

    i found one on the Codeplex, this will check Nt auth group, you have to modify accordingly your need and test it in your test farm.script is for 2010 but i am positive it will work for 2013 as well.
    The Sixth script lists
    all the site collections which have "NT AUTHORITY\authenticated users" in
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • How to display a db record with a variable number of joined records

    I'm building a website for an airshow http://www.hollisterairshow.com and the organiser would like to post a list of things he needs for the show and have people respond via the website. For example, he might need 20 tents and potentially up to 20 people could respond, each offering one tent, or fewer people could each offer several tents. I'd like to create a view showing the item needed and underneath it one row for each offer he receives. I already have a couple of tables defined, one called "needs" and the other called "offers" , the "offers" table has a column called "needId" which is the index from the needs table.
    So far I have created a recordset to join the tables but each row contains the need and the offer so I'm seeing the need repeated on each row and I only want to see it once. Here's the SQL generated by DW CS4
    SELECT needs.needId, needs.title, needs.`description`, needs.quantity, needs.needMet, offers.needId, offers.offerId, offers.name, offers.email, offers.phone, offers.quantity, offers.`comment`
    FROM needs, offers
    WHERE needs.needId = offers.needId
    ORDER BY needs.title
    I'm sure there must be a simple solution to this but I'm unable to figure it out. I'm new to SQL and doing this as a volunteer for the airshow.
    Thanks,
    Tony

    Thanks so much, for pointing this out. This looks like it'll do what I need. I think I understand the code so I'll modify it and try it.
    It looks like it will create an output that looks something like this
    Need1    Offer 1
                 Offer 2
                 Offer 3
    Need 2     Offer 1
                   Offer 2
    etc....
    This is certainly workable. Ideally I'd like to create something like this
    Need 1
         Offer 1
         Offer 2
         Offer 3
    Need 2
         Offer 1
         Offer 2
    Is there a way to do this? Would I need a different recordset or am I still looking at a layout issue?
    Thanks again for the help.
    Tony

  • How to display the detailed navigation with the Search Results

    Hello Gurus,
    I was able to display the search results in the same frame rather than opening the new window and getting it displayed. Now when the search results are displayed, my detailed navigation and portal favorites etc.. all the iviews are automatically suppressed.
    Please help me displaying the search results with Navigation Panel.
    Regards
    V.

    Hi Vaibhav,
    What do you mean by suppressed?
    Is it gone, or just closed?
    If it is just closed, you can try 2 things:
    1. Check if the property "Initial State of Navigation Panel" of the page has any influence.
    2. There is a javascript method that opens it.
    You can see it by importing the file '<b>com.sap.portal.layouts.framework.par.bak</b>'.
    Navigate to
    System Administration -> Support -> Support Desk -> Portal Runtime -> Browse deployment
    then the folder
    ROOT/WEB-INF/deployment/pcd
    and press download.
    Import from par to Developer Studio, and check the javascript files under dist/PORTAL-INF for a function called something like 'expandTray'.
    Hope that helps,
    Yoav.

  • Using Pagination, but Defaulting initial page to display all results

    Ok, I've inherited a JSF application that uses pagination to display results in a table. There's an enhancement request to initially display all the results of a table yet allow end users to "go into pagination mode." I've looked all over the web and played around with the code. Currently, I'm setting paginationbutton to true, but paginationcontrols to false. This remove the pagination navigation buttons, and initially displays all the results. Users can even go from displaying all results into pagination mode. However, the navigation is lost since paginationcontrols is set to false.
    Anybody know of a way to achieve what I'm looking for?
    Thanks,
    James

    Hi,
    When you execute any query on web, it actually uses a standard template which is present i.e. 0Analysis_Pattern and shows the report accordingly. Hence, your output will be based on the settings done in this template.
    So, I guess, you need to modify the number of rows to be visible at a time in the standard template.
    Hope this helps ..!
    -Pradnya

  • Can you pass an array URL variable

    Hi,
    Doing a form which I want to validate, then re-display with
    error messages and the keyed data still in place should there be
    errors, or go onto a second form if all ok.
    I have tried to use <form
    action="<?=$_SERVER['PHP_SELF']?>" but as the various
    outcomes result in different screens I can't see how to do it
    without having reams of duplicate code - I couldn't make it work
    satisfactorily anyway.
    So I decided to do it in two stages - form (user screen) + a
    separate validation routine which passes validation results back if
    there are errors by calling the first screen but with URL variables
    to trigger process variations or go onto screen 2 if all ok.
    But I'm struggling with this .. two questions:
    i) Ideally I would like to use a session variable to pass
    actual error messages back to screen one in the event of errors but
    if I undertand things correctly (which is by no means certain)
    $S_Session is already an associatve array so it wouldn't be so easy
    to just add a variable number of messages to it and then know what
    you are unpacking elsewhere ... do you know what I mean?
    Perhaps if I give you my second question it may help
    illustrate what I'm going on about in part 1
    ii) The way I have tried to do it is to set it up as an array
    ($ERRORS) in the validation module and then added a text string
    each time I hit a specific error. The hope was that I could then
    send this back via the URL for further process but I'm getting
    syntax problem so maybe this is not possible .... a brief example
    Input Form php:
    $ERRORS = array();
    $ERRORS = $_GET['errors']
    if (sizeof($ERRORS) > 0) {
    echo "<p class=\"val_err_hdr\"> *** Validation
    error(s) - please correct the entries and try again ***
    </p>";
    blah blah
    Validation php:
    $ERRORS=array();
    if(!$loginFoundUser) {
    $ERRORS[] = "This e-mail address entered has already been
    registered on our database - if you have already registered you
    can"; }
    header("Location: input.form.php?errors=$ERRORS");
    When I run this I get a syntax error 'unexpected T_IF' on the
    'sizeof'' function condition.
    Any help much appreciated.

    .oO(patricktr)
    > Doing a form which I want to validate, then re-display
    with error messages and
    >the keyed data still in place should there be errors, or
    go onto a second form
    >if all ok.
    OK, quite common.
    > I have tried to use <form
    action="<?=$_SERVER['PHP_SELF']?>"
    Avoid short open tags, they are unreliable. Use "<?php
    print " instead
    of just "<?=" to be safe and independent from the server
    configuration.
    >but as the
    >various outcomes result in different screens I can't see
    how to do it without
    >having reams of duplicate code - I couldn't make it work
    satisfactorily anyway.
    What's a "screen" in this case? Just another part of the form
    or a
    completely different page?
    > So I decided to do it in two stages - form (user screen)
    + a separate
    >validation routine which passes validation results back
    if there are errors by
    >calling the first screen but with URL variables to
    trigger process variations
    >or go onto screen 2 if all ok.
    Don't use URL parameters in such a form processing scenario.
    Use a
    session instead, that's what they are for. The length of URLs
    is limited
    and there are things you simply don't want to pass between
    pages, but
    keep on the server instead.
    > But I'm struggling with this .. two questions:
    >
    > i) Ideally I would like to use a session variable to
    pass actual error
    >messages back to screen one in the event of errors but if
    I undertand things
    >correctly (which is by no means certain) $S_Session is
    already an associatve
    >array so it wouldn't be so easy to just add a variable
    number of messages to it
    >and then know what you are unpacking elsewhere ... do you
    know what I mean?
    The $_SESSION array itself is strictly associative, the used
    indexes
    must be strings or the serialization of the session data will
    fail.
    But if course you can always do things like this:
    $_SESSION['errors'] = array();
    $_SESSION['errors'][] = 'something went wrong';
    > Perhaps if I give you my second question it may help
    illustrate what I'm going
    >on about in part 1
    > ii) The way I have tried to do it is to set it up as an
    array ($ERRORS) in the
    >validation module and then added a text string each time
    I hit a specific
    >error. The hope was that I could then send this back via
    the URL for further
    >process but I'm getting syntax problem so maybe this is
    not possible .... a
    >brief example ...
    As said above - use the session instead.
    > Input Form php:
    > $ERRORS = array();
    > $ERRORS = $_GET['errors']
    There's a ';' missing at the EOL (this causes the error you
    mentioned
    below).
    Just a naming hint: Variables should not be named all
    uppercase (except
    for the predefined superglobal arrays). Such names should be
    reserved
    for constants. The most common style looks like this:
    myNiceFunction()
    $myNiceVariable
    MY_NICE_CONSTANT
    > if (sizeof($ERRORS) > 0) {
    if (!empty($_SESSION['errors'])) {
    > header("Location: input.form.php?errors=$ERRORS");
    The Location URI must be absolute including scheme and
    hostname. This is
    required by the HTTP spec:
    header("Location:
    http://$_SERVER[HTTP_HOST
    But I'm still not sure why you would need this redirect. The
    entire
    handling of a form (validation, processing) can be done on a
    single
    page. Only if the processing succeeds, you might want to
    redirect to
    some result page.
    Micha

  • Database creation with ASM using dbca

    hi all,
    i found the steps to create the database using ASM diskgroup.
    but i received errors when configuring the FRA(flash recovery area), DBF(normal), +ARCH(archival dest),
    i tried atleast 2 to 3 times from scratch but found the same error....................
    ORA: 19624
    ORA: 19870
    here are the steps can somebody correct these steps..................
    Create Virtual Disks from VM Ware software when server is down.
    Choose Edit Virtual Machine Settings.
    Click on Add button
    Press Next and Highlight Hard Disk, then click Next
    Check ‘Create a New Virtual Disk’
    Choose SCSI as type
    Select Size as 2 GB
    Name the virtual disk as ‘ASMDBF1.vmdk’
    Create additional disks as:
    ASMDBF1.vmdk for DBF files
    ASMDBF2.vmdk Failover group
    ASMFRA.vmdk Flash Back Recovery Area
    ASMREDO.vmdk Redo Log Area
    ASMARCH.vmdk Archived Logs
    •     Start up the server OraWorld1
    •     Go to Disk Management and you will be prompted with a screen which should display all five disks with a check mark. Accept defaults and Click next.
    •     On second script all five will be unchecked, click Next
    •     Press Finish to complete and you should see all 5 disks as Type Basic Unallocated. For each of the disk perform:
    1.     Right click, New Partition, Extended Partition and Finish
    2.     Right click, New Logical drive, Do not assign drive letter nor partition it.
    3.     From command prompt type Diskpart and enter Automount enable.
    4.     From command prompt, configure basic CRS services as
    5.     C:\oracle\product\10.2.0\db_1>localconfig add
    6.     C:\oracle\product\10.2.0\db_1>localconfig add
    7.     Step 1: creating new OCR repository
    8.     Successfully accumulated necessary OCR keys.
    9.     Creating OCR keys for user 'administrator', privgrp ''..
    10.     Operation successful.
    11.     Step 2: creating new CSS service
    12.     successfully created local CSS service
    13.     successfully added CSS to home
    •     Launch DBCA and choose Configure Storage Management.
    •     Select Create New group, choose stamp disks which will show you all of your five disks. Configure ASM links to all these disks as:
    1.     ORCLDISKASMDBF1 \Device\Harddisk1\Partition1
    2.     ORCLDISKASMDBF2 \Device\Harddisk2\Partition1
    3.     ORCLDISKASMFRA \Device\Harddisk3\Partition1
    4.     ORCLDISKASMREDO \Device\Harddisk4\Partition1
    5.     ORCLDISKASMARCH \Device\Harddisk5\Partition1
    Now make Change Disk Discovery Path as Null and you should see all disks.
    Now create Disk groups as :
    ARCH \\.\ORCLDISKASMARCH External 1GB
    REDO \\.\ORCLDISKASMREDO External 1GB
    FRA \\.\ORCLDISKASMFRA External 2GB
    DBF (MAIN GROUP WITH 2 SUB-GROUPS) Must create as Normal Redundancy
    DBFP \\.\ORCLDISKASMDBF1 External 2GB
    DBFS \\.\ORCLDISKASMDBF2 External 2GB
    You now have a running ASM instance on the server.
    •     Checking ASM instance
    You can always use DBCA to check settings of ASM.
    Alternatively, go to command prompt:
    Set ORACLE_SID=+ASM
    Sqlplus /nolog
    Connect sys/password as sysdba
    Show sga (80MB)
    Total System Global Area 83886080 bytes
    Fixed Size 1247420 bytes
    Variable Size 57472836 bytes
    ASM Cache 25165824 bytes
    SQL>desc You can then check C:\oracle\product\10.2.0\db_1\database for these files. You can also view v$parameter for all possible values for ASM instance.
    +asm.asm_diskgroups='DATA1','ARCH','REDO','FRA','DBF'#Manual Mount
    *.asm_diskgroups='DATA1','ARCH','REDO','FRA','DBF'
    *.asm_diskstring=''
    *.background_dump_dest='C:\oracle\product\10.2.0\admin\+ASM\bdump'
    *.core_dump_dest='C:\oracle\product\10.2.0\admin\+ASM\cdump'
    *.instance_type='asm'
    *.large_pool_size=12M
    *.remote_login_passwordfile='SHARED'
    *.user_dump_dest='C:\oracle\product\10.2.0\admin\+ASM\udump'
    You can change some of the values like large pool and even db cache size. You can also manually create the disk group as:
    Create diskgroup DBF NORMAL redundancy
    Failgroup flgrp1 disk ‘\\.\ORCLDISKDATA0’, ‘\\.\ORCLDISKDATA1’
    Failgroup flgrp2 disk ‘\\.\ORCLDISKDATA2’, ‘\\.\ORCLDISKDATA3’;
    Check Candidate disks:
    select group_number, disk_number, mount_status, header_status, state, path from v$asm_disk;
    Other useful queries:
    Select group_number, name, total_mb, free_mb, state, type
    From v$asm_diskgroup;
    Select group_number, disk_number, mount_status, header_status, state, path, failgroup
    From v$asm_disk;
    You can use sql commands to perform most of the ASM tasks, however EM console can also be used here
    Oracle Database Installation
    •     Launch DBCA
    •     Choose Create Database and select OLTP type
    •     Name it as ORCL2, choose ASM as file system, select all disk groups to be used.
    •     Use oracle managed files as:+DBF press Next
    *•     Specify Flash Recovery Area as +FRA*
    *•     Enable archiving at +ARCH*
    *•     Choose Auto SGA as 55% of memory*
    *•     Leave else default and complete DB creation.*
    *•     Launch NetConfig and define Listener with default settings.* here i received the errors,.................
    Database ORCL2 is created with the following attributes:
    NAME: ORCL2
    SPFILE: +ARCH/ORCL2/spfileORCL2.ora
    URL: http://oraworld1:1158/em

    Strange, those messages are RMAN backup errors -- are you trying to backup the database?
    Or...if you selected "create starter database" it may be that dbca is not finding the backup files from the "demo" database.
    :p

  • How to link to an image from database result.

    Hey all,
    So i have created a search form for a user to search a vehicle in a scrap yard. The vehicles are stored in database with no images( i have no idea how to do this. So i want to be able to allow the user to click on a link to view the vehicle from the search result in a database. Any ideas?
    Thank you! 

    Sorry, I'm new to this game. Thanks. Well i'm using MySQL and Php. Here is the code from my stock list page which display all the results in the database aswell as a search engine to search for specific stock by searching for keywords. I know its very scrappy but here it is anyway:
    <?php require_once('../Connections/cbdb.php'); ?>
    <?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 = "login.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;
    mysql_select_db($database_cbdb, $cbdb);
    $query_rsStock = "SELECT * FROM stock ORDER BY `date` DESC";
    $rsStock = mysql_query($query_rsStock, $cbdb) or die(mysql_error());
    $row_rsStock = mysql_fetch_assoc($rsStock);
    $totalRows_rsStock = mysql_num_rows($rsStock);
    $maxRows_rsStock = 30;
    $pageNum_rsStock = 0;
    if (isset($_GET['pageNum_rsStock'])) {
      $pageNum_rsStock = $_GET['pageNum_rsStock'];
    $startRow_rsStock = $pageNum_rsStock * $maxRows_rsStock;
    mysql_select_db($database_cbdb, $cbdb);
    $key = $_GET['keyword'];
    $query_rsStock = "SELECT * FROM stock WHERE stock.keywords LIKE '%$key%' ORDER BY stock.date DESC";
    $query_limit_rsStock = sprintf("%s LIMIT %d, %d", $query_rsStock, $startRow_rsStock, $maxRows_rsStock);
    $rsStock = mysql_query($query_limit_rsStock, $cbdb) or die(mysql_error());
    $row_rsStock = mysql_fetch_assoc($rsStock);
    if (isset($_GET['totalRows_rsStock'])) {
      $totalRows_rsStock = $_GET['totalRows_rsStock'];
    } else {
      $all_rsStock = mysql_query($query_rsStock);
      $totalRows_rsStock = mysql_num_rows($all_rsStock);
    $totalPages_rsStock = ceil($totalRows_rsStock/$maxRows_rsStock)-1;
    ?>
    <!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"><!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Stock Management System</title>
    <!-- InstanceEndEditable -->
    <link href="../style/admin_style.css" rel="stylesheet" type="text/css" media="screen" />
    <!-- InstanceBeginEditable name="head" -->
    <script type="text/javascript">
    function tmt_confirm(msg){
    document.MM_returnValue=(confirm(unescape(msg)));
    </script>
    <!-- InstanceEndEditable -->
    </head>
    <body>
    <div id="wrapper">
    <div id="header">Eugene Hoade Car Breakers</div>
    <div id="navigation">
    <ul id="mainav">
    <li><a href="stock_list.php">List of stock</a></li>
    <li><a href="stock_add.php">Add new stock</a></li>
    <li></li>
    <li><a href="logout.php">Logout</a></li>
    <li id="front"></li>
    </ul>
    </div>
    <div id="container"><!-- InstanceBeginEditable name="Content" -->
      <p id="ptitle">Stock</p>
      <form id="forminsert" name="forminsert" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
      <table border="0" align="center" cellpadding="0" cellspacing="0" id="tblinsert">
      <caption>
        Search for Stock
      </caption>
      <tr>
        <th><label>Keyword:</label></th>
        <td><input type="text" name="keyword" id="keyword" /></td>
        <td><input type="submit"  id="button" value="Submit" /></td>
        </tr>
    </table>
      </form>
      <?php if ($totalRows_rsStock > 0) { // Show if recordset not empty ?>
      <table border="0" align="center" cellpadding="0" cellspacing="0" id="tblrepeat">
        <tr>
          <th scope="col">Make</th>
          <th scope="col">Model</th>
          <th scope="col">Year</th>
          <th scope="col">Engine cc</th>
          <th scope="col">Fuel</th>
          <th scope="col">Doors</th>
          <th scope="col">Body</th>
          <th scope="col">Arrival Date</th>
          <th scope="col">Reg.</th>
          <th scope="col">Edit</th>
          <th scope="col">Delete</th>
        </tr>
        <?php do { ?>
          <tr>
            <td><?php echo $row_rsStock['make']; ?></td>
            <td><?php echo $row_rsStock['model']; ?></td>
            <td><?php echo $row_rsStock['year']; ?></td>
            <td><?php echo $row_rsStock['cc']; ?></td>
            <td><?php echo $row_rsStock['fuel']; ?></td>
            <td><?php echo $row_rsStock['doors']; ?></td>
            <td><?php echo $row_rsStock['body']; ?></td>
            <td><?php echo $row_rsStock['date']; ?></td>
            <td><?php echo $row_rsStock['registration']; ?></td>
            <td><a href="stock_edit.php?id=<?php echo $row_rsStock['stockId']; ?>">Edit</a></td>
            <td><a href="stock_remove.php?id=<?php echo $row_rsStock['stockId']; ?>" onclick="tmt_confirm('Are%20you%20sure%20you%20want%20to%20perform%20this%20action?');ret urn document.MM_returnValue">Delete</a></td>
          </tr>
          <?php } while ($row_rsStock = mysql_fetch_assoc($rsStock)); ?>
      </table>
      <?php } // Show if recordset not empty ?>
    <?php if ($totalRows_rsStock == 0) { // Show if recordset empty ?>
      <p>Sorry, there are no records matching your searching criteria.</p>
      <?php } // Show if recordset empty ?>
    <!-- InstanceEndEditable --></div>
    <div id="footer"><p>© <a href="http://www.blablabla.com/" title="Web Designer" target="_blank">Crockett Ink Web Design</a></p></div>
    </div>
    </body>
    <!-- InstanceEnd --></html>
    <?php
    mysql_free_result($rsStock);
    ?>

  • Capturing a dynamic swf with url parameters?

    Hi,
    I'm wondering if it's possible for users to capture an swf
    with URL variables?
    for example ->
    www.somesite.com/foo.swf?param1="value"&param2=value"
    normal swf rippers will catch only the base "naked" swf, but
    is there a way to fully capture the whole flash object after it has
    rendered the parameters?
    (for example, if it's an ad, the full ad with all the
    elements will be captured)
    this can help me to quickly generate demo stand-alone
    instances for some apps i'm building, instead of compiling them
    separately

    oops...sorry for double posting..

  • Conditions is not displaying the required result

    Hi Experts
    i have a query with Key figure (calculated on query level) No of days and i have created a condition with characterstic assignment all chars and created a condition on this key figure no of days, eventhough i have enough values which satisfiy the condition but my query is just displaying over all result
    what could be the reason.
    thanks and regards
    Neel

    Hi all
    Edwin, how are you after a long time...
    The chars in my query are
    fiscal char, pur org, vendor, document date, no of days
    here the no of days is calculated from current day - document date
    when i check my query result without any of hte conditions active then its displaying all the rows and in that i can even check i have values like for example i have a condition do display no of days less than or equal to 30 so it will display all the rows with no of days less than or equal to 30 am i right i have values in that column as 17, 28, 29  and i am assuming that it should display these three rows.
    but surprisingly its not ...
    thanks and regards
    Neel

Maybe you are looking for

  • Can I use Elements 6 for Mac with Mavericks 10.9?

    I have a licensed version of Elements 6 for the Mac. Will it run with Mavericks 10.)

  • Movement type used for ISSUE.

    Hello all,   I need to create report,where i need to list out all the  movment type used for ISSUE(Consumption).   How to list out all movement type used only for ISSUE(consumption).Is there any logic can be used here? Useful answer will be appreciat

  • BC_MSG delete messages

    Hello! I have SAP PI 7.3.1 single stack I want to delete messages from the  table BC_MSG standard Job not delete messages what should I do regards, Rinaz

  • Oracle, VMS, and Forte

    What is the most recent version of Oracle in use with Forte under VMS, and what version of Forte are you using with it? We're at Forte 3.0.G.2, but still at Oracle 7.3.2.3.0, because when we tried 7.3.2.3.2 it wouldn't link (and no, I don't remember

  • Apex_mail.send / HTML formatting Ignored When Sent via Trigger

    I have a PL/SQL procedure that sends a formatted email using the apex_mail.send procedure. This procedure works 100% perfectly if I run the procedure either from a scheduled job (using dbms_scheduler), or when I siimply call the procedure "ad hoc" fr