Counter field in the database table

Am just thinking about how to solve a small problem that is new for me in PHP, but I hope not complex.

Basically, I have a database of holiday resorts, and my client would like to keep track of how many people click through to own the stations of our website website.

So I thought that if I have a ClickCounter field, which is initially set to 0, is there a way to have a link that, when clicked on, would be to increment the ClickCounter field by 1.

If someone could help me get started with this, that would be much appreciated.

Thank you.

Change this:

mysql_select_db($database_databaseConnection, $databaseConnection);
$query_rsLodgeURL = "SELECT LodgeURL FROM lodges WHERE LodgeID = '$the_resort'";
$rsLodgeURL = mysql_query($query_rsLodgeURL, $connSafari) or die(mysql_error());
$row_rsLodgeURL = mysql_fetch_assoc($rsLodgeURL);
$totalRows_rsLodgeURL = mysql_num_rows($rsLodgeURL);

To do this:

mysql_select_db($database_databaseConnection, $databaseConnection);
$query_rsLodgeURL = sprintf("SELECT LodgeURL FROM lodges WHERE LodgeID = %s",
GetSQLValueString($the_resort, "int"));
$rsLodgeURL = mysql_query($query_rsLodgeURL, $connSafari) or die(mysql_error());
$row_rsLodgeURL = mysql_fetch_assoc($rsLodgeURL);

echo $reLodgeURL ["LodgeURL"]; should output the URL whole lodge as http://www.singita.com or http://www.behobeho.com etc. based on the URL LodgeID = 2 or 7 or other parameter.

Can change this:

if ($_GET['LodgeID'] == "1") {
header ("Location: http://www.elsaskopje.com");
}
if ($_GET['LodgeID'] == "2") {
header ("Location: http://www.behobeho.com");
}
if ($_GET['LodgeID'] == "7") {
header ("Location: http://www.singita.com");
}

To do this:

if ($row_rsLodgeURL['LodgeURL'] != "") {
header("Location: $row_rsLodgeURL['LodgeURL']");
} else {
header ("Location: http://www.google.com");
}

See you soon!

Tags: Dreamweaver

Similar Questions

  • Values entered into a textarea unwritten in the database table

    I have a very strange situation.  I have a form that has a certain number of fields, all fields of text standard apex.

    I have a button that calls a dynamic action that writes the values of these fields in their columns in the table.  No problem with this.

    I just added a textarea field defined with a maximum length of 300 characters, which maps to a new column in the database table that is defined as VARCHAR2 (300).

    I modified the PL/SQL to include the value of this new field in the database table writing.  When I run the dynamic action, everything else in the form is updated, but the text in the text not added to the table box.

    In session data, the data on the page are correct. The Session State of the textarea field is also correct.

    This isn't just a text box, it's ANY textarea I put on this page.  If I take a text field and transformed into a textarea field, the same thing happens.  If I take the new textarea field and transformed into a text field, the data gets written to the database table.

    Can someone explain this?  I can get by with only text fields, but it would be much better if I could have a field where mentions that he could properly wrap to the next line.

    Thank you!

    John

    John,

    edit your Textarea field and change in the Source Section as

    Source: always, replacing any value existing in State of Session

    Source type: column database

    and in

    Source value or Express: (write the name of the column in the data to be store)

    do not change this things your textarea data records in the database Table...

  • Check if e-mail exist in the database table

    I stumbled on this a few times before, but I'm not familiar with this system, whenever you enter an emailaddress, you see as a clock indicating the system checks if the e-mail address may be used, in other words, is not yet in a table. I would like something similar and when the "audit" is done and the emailaddress is not in the DB table, the rest of the form appears, otherwise, an error message indicates the address is already in use. I guess this could be done using Javascript, but is there also a PHP way to do this?

    It's simple to achieve. Create a query that filters your e-mail address in the database table WHERE = POST of the email field in the form is sent. If the query returns a line then the email already exist, otherwise it is available and can treat the rest of the form.

  • LabVIEW 2013 close when I try to read the database table.

    LabVIEW 2013 close when I try to read the database table.
    I get the error message, Labview falls just crashes. I use Labview x 32 and connective Toolkit of connectivity of database on Windows 7 x 64. I connect to PostgreSQL with ODBC driver, the connection is stable.
    In my database, I have a lot of tables, I read all those without one.
    When I try to read table bad I get data then labview crash. When I restart Labview, I have no message on the error.
    Also I try to use LabSQL-1. 1a. But it has the same result.

    I found the solution.

    I think the problem was that I have very large table in my database.

    At the beginning I received data from table with next quiry:

    SELECT column1, column2 FROM 'table ';

    But when I write then:

    SELECT column1, (column2, ',') array_to_string FROM 'table ';

    all worked!

  • Given Oracle Spatial are stored in the database tables?

    Given Oracle Spatial are stored in the database tables?

    Oracle spatial is DBMS oracle server functionality. It allows you in NATIVE mode, store and manage all standard types of spatial data and their attributes and metadata in the oracle database enterprise, in the way that you are quite familiar with. on top of standard oracle database features, adds types of geographic data, spatial index, geometric operators and queries, functions, spatial and analytical, to name a few.

    MapViewer is a feature of Oracle Fusion Middleware, which makes cards using spatial data managed by Oracle Spatial. That's what you called "generator of maps. but of course, it's not just a map generator, he has much more to offer, such as MapBuilder, WMS, Oracle cards.

    For more information, please see the technical details:

    http://www.Oracle.com/technology//products/spatial/index.html
    http://www.Oracle.com/technology/products/MapViewer/index.html

  • Insert/update of the individual fields in the DB Table

    So maybe I have a few noble desires, but I have my trying to find a way to change 1 single record (field) in a table.

    SCENARIO: I want to have a table that has the columns 'cid', 'class_name' and 'open_seats '... For example, if you have a line with values:

    1, namemw520, then a second, 25'

    2, nametr520, 32', and a third,.

    etc...

    Then in a form when the person fits and chooses a class, into submission, he will subtract one from the open_seats column and affect only the row of the selected class_name.

    WHAT I TRIED:

    So far, the only thing I can think is to have several queries to several tables in a line, and then update a form based on a selection of drop-down list doesn't seem to work, in addition, there are like 30 classes and I don't want to create tables of 30 DB, if it can be avoided. Or I'm WAY over my head on this one?

    Any help would be appreciated.

    TIA

    A more standardized design of database win the obligation to do something.

    Consider a design where your table has a field of ability instead of a seats_remaining.  Once you have configured a class, you should not change this value.  Then, as people sign up, you fill in a many-to-table number.  I hope that you are already doing.  Then to see how many points you have left, you do something like this:

    Select the capacity-

    (select count (*)

    your many at table number

    where is this class) seats_remaining

    your table class

    where is this class

  • storage base problem edit a field in the database

    Hi all

    In fact, I'm trying to insert the data into a database table using sql lite.

    the code below is I tried to recover the data from the field of basic editing and I'm not

    able to read the values. Is it the correct way to insert the data from the edit field or

    am I missing something or is this the wrong way to insert data in database tables.

    st=db.createStatement("INSERT INTO Personal(name,phone,email,city) VALUES('nameField.getText()','phoneField.getText()','emailField.getText()','cityField.getText()')");
    

    However the code below works fine where I am inserting data in the as shown below

    and I am able to read the data. But the thing I want to read data from the basiceditfield.

    st=db.createStatement("INSERT INTO Personal(name,phone,email,city) VALUES('saran',9036114828,'[email protected]','Bangalore')");
    

    Thanks in advance...

    Change your sql for:

    st=db.createStatement("INSERT INTO Personal(name,phone,email,city) VALUES(" +
    "'" + nameField.getText()  + "'," +
    "'" + phoneField.getText() + "'," +
    "'" + emailField.getText() + "'," +
    "'" + cityField.getText()  + "')");
    
  • Accuracy of counties line in the MySQL Table

    I was just looking at the counts of row of the table for some of my MySQL tables listed in HQ... some of these tables should only increase in number of lines (never delete us rows), but table varies greatly as to how many lines is in the table.

    So I have two questions...
    (1) these figures are absolutely not accurate... his watch a table which always increases in length as having 100 lines, then 75 and 90 and 88, etc..  IT should show 100, 101, 104, 110.

    (2) I know that the MySQL "SELECT COUNT (*) FROM tablename" statement is VERY slow on my servers.  HQ runs this command on my database?  If so, I need to disable this "feature" because he's going to kill my database.  The COUNT command on a table over 1 million lines takes an incredible amount of resources on my MySQL server... and we try to avoid to execute commands to COUNT on these large tables...
    (a) if it executes a SELECT COUNT?
    (b) can I turn that off?

    Thank you!
    Stephen

    Hello

    It seems to me that hyperic is not a command select count(), but one
    display the State of the table. It is incorrect when you use innodb tables...

    "Some drivers of storage, such as MyISAM tables, store the exact number. For others
    engine storage, such as InnoDB, this value is an approximation and may
    changing the actual value by as much as 40-50%. In this case, use
    SELECT COUNT (*) to get an accurate count. »

    The advantage of this is that it is not processor intensive.

    Rgds

    Simon.
    >
    > I was just looking at the counts of row of the table for some of my MySQL tables
    > listed in HQ... some of these tables should only be more and more
    > lines (never delete us lines), but the picture varies greatly as to how much
    > rows are in the table.
    >
    > So I have two questions...
    > 1) these numbers are absolutely not accurate... its a table showing that
    > increasing in length as having 100 lines, then 75, then 90, then 88,.
    > etc.  IT should show 100, 101, 104, 110.
    >
    (> 2) I know that the MySQL "SELECT COUNT (*) FROM tablename" statement is
    > VERY slow on my servers.  HQ runs this command on my database?  If
    > then I have to disable this "feature" because he's going to kill my database.  The
    > Order of COUNTY on a table over 1 million lines takes an incredible amount
    > resources on my MySQL server... and we try to avoid running COUNT
    > orders on these large tables...
    (> a) if he executes a SELECT COUNT?
    (> b) can I turn that off?
    >
    > Thank you!
    > Stephen
    >
    > --
    > This message has been scanned for viruses and
    > dangerous by MailScanner and is content
    > supposed to be clean.

  • Can I directly change the value of the dist_id field in the database?

    When I tried a url created by gblinkapp, Adobe Digital Editions gave me an E_LIC_NO_DISTRIBUTION_RIGHTS error.

    I'm looking on the database:

    • I have 2 records in the table Distributor , first integrated and mine.
    • In the distributionrights and distusednonce tables, the value of the dist_id field (which is the primary key of table Distributor ) is always the "built-in" ID

    I guess that ACS3 to ACS4 migration was made prior to the addition of our real Distributor...

    Your quick start guide explains clearly that "the integrated distributor" cannot be used to distribute the books.

    If can I update the dist_id directly in the tables distributionrights and distusedonce with the dist_id of our distributor without future problems in ACS4 value?

    If this is not the case, how can I change the distributor of my books safe?

    Thank you

    You do not want to delete the record for the integrated Distributor, because that will cause problems and given what you have described the probably won't solve the problem.

    The most common cause of E_LIC_NO_DISTRIBUTION_RIGHTS is because you try to make a loan (URL with action = enterloan instead of action = enterorder), when you have not created a right distribution of type "ready".  In the administration console, if you have already created a right distribution of type buy, then in the inventory tab, with the Distributor, then the resource selected, you just need to click on the icon "+" next to the distribution rights and to create a new right 'ready' type distribution  If your problem is that you did not create the distribution rights for the Distributor, and then you can drag the resource on the distribution server to create a first 'buy' distribution right.

    Alternatively, you can also use DistribTool.jar to create the appropriate distribution right.  Documentation for this tool is in the documentation of source sample.

    However the DistribTool and AdminConsole end up doing the same thing, which is to use the ManageDistributionRights admin web service endpoint to create a new right of distribution.  If these tools are not to your liking, you're probably better choose a writing tool in your preferred language to make calls to services web admin, so that you can make it work as you want it to work instead of the DistribTool way or AdminConsole works.

  • CRUD using ADF fails to update the database table

    Hi all

    I am very new FAD and JDev. I use JDev 11.1.1.2.0 and oracle 10g DB.

    I created the necessary
    1 model, view, control files of data using JDev to a DB table control.
    2 .jspx file having a "Panel Accordin ' and a page layout"Panel formLayout"to display the fields in table required on the page."

    I use Panel corre layout to display data with buttons of browsers and works very well.
    In the the Panel layout form, after posting the fields I added the button 'submit '. I've linked this button with the operation "Commit" by drop and simple drag.
    PS: I've added the fields by simple drag / drop control of the data file maps to the table in question.

    The performance of the page I find things work fine until I want to use the submit button. It just updates the UI front, but when I check in my database table I find that it has not been updated.

    I am naïve. Pls Guide.
    A site with step - by - development of end to end step will be very large.

    Desperately waiting to get this resolved.

    Thank you all

    Published by: user8925296 on January 16, 2010 02:13

    The performance of the page I find things work fine until I want to use the submit button.

    See if your button submit has an EL expression in its property "disabled".
    Depending on how you want it, delete this EL expression or add partialTriggers button to make it refresh partially each time that a field can be changed on your page changes...
    (Assuming it's all ADF faces that you use. Also, see more here: Re: activate/register button )

  • Adding field in the item table programmatically

    Hello.

    I'm doing a generic 'engine' for generating test reports/certificates.

    I made a custom data containing type report item, I used to do a local variables array of report called table of report item items.

    The data type contains generic areas (chain of title elements, a string of type item, etc.) and a container of the element data.

    The idea is to increment the array of items to report with report items and then fill the data container of the element with the fields of for example a Table element container.

    Either that, or just add a field in the report item with the data Table element type.

    But I can't find a way to add fields programmatically in a container.

    Anyone know if this is even possible?

    Found!

    Using from one stage of education, who points to the array of report items using the NewSubProperty method.

    Finished with the following statement:

    Parameters.Report_Element_Array.InsertElements (GetNumElements (Parameters.Report_Element_Array), 1, 0),
    Parameters.Report_Element_Array [GetNumElements (Parameters.Report_Element_Array)-1]. NewSubProperty("Element_Data",PropValType_NamedType,False,"NSE_Report_Table",0)

  • I am not able to see all the fields in the Contact table available on the report of the Contact field values?

    Hello!

    I'm looking at an instance of Eloqua shows that 10 of the possible 100 s of the fields in the table contact E10.  Where are the rest of the fields?

    Kind regards

    Alok

    Hi Alok,

    We have seen, the installation program for all sorts of things, but you can set a maximum to see everything you want to see. If you are the administrator, you can go to settings-> fields & views. Here, you can switch around with how you want it to look.

    Kind regards

    Alok

  • Creating asset - do not fill column subtype in the database table

    Hello

    I'm having a conclusion active problem newly created in the donor, which means that I can't use in other assets.

    What I found that new capital recently, do not have the subtype column overflows into the database. I think that might have effects in the content tree, but I can't even find in the search without any filter bar.

    This is the screenshot of the table filtered by flextemplateid:

    Tablea.png

    And here are the results of research, that I get when I search in the content also filtered by flextemplateid tree:

    lista.png

    As you can see, those with the correctly filled subtype is indicated.

    Someone knows why this phenomenon happens?

    What can I do to fix this?

    Thank you

    Mariana

    I could finally see my newly created goods. That's what I did:

    Tab admin - configure global search

    and then I have re-indexed the assets that I needed.

    He fixed it.

  • Select the value of the field in the database column stores xml as a varchar

    Hi all

    Oracle version is 11 GR 2.

    I have a column of a database in which we store the XML string varchar2.

    "I need to extract only newvalue when field nameof the property ="modifiedBy'. '.

    In this case my answer would be - maker16

    My XML is as below.

    with t as
    (
    select '<?xml version="1.0" encoding="UTF-8"?>
    <changeinfo><property name="checkedOn" newvalue="03/21/2013 15:51:11" oldvalue="03/21/2013"/><property name="modifiedOn" newvalue="07/22/2013 14:04:55" oldvalue="03/21/2013"/><property name="phoneNo" newvalue="9942251"/><property name="modifiedBy" newvalue="maker16" oldvalue="clarissamaker"/></changeinfo>' as datacolumn
    FROM dual
    )
    select extractvalue(datacolumn,'/changeinfo/property name[@property name="modifiedBy"]/newvalue') from t;
    
    

    How to write a select statement to get the above result?

    Thank you

    SID

    You can do it like

    1. get the name and NewValue as columns and then create a filter with the WHERE clause.

    2. or you can filter when you set the path itself.

    --I have not applied the WHERE clause to filter the NAME. You can do that.
    
    SQL> with t as
      2  (
      3  select '
      4  
      5  
      6  
      7  
      8  
      9  ' as datacolumn
     10  FROM dual
     11  )
     12  select t1.name, t1.newval
     13    from t
     14       , xmltable
     15         (
     16            '/changeinfo/property' passing xmltype(datacolumn)
     17            columns
     18              name varchar2(100) path '@name',
     19              newval varchar2(100) path '@newvalue'
     20         ) t1;
    
    NAME                           NEWVAL
    ------------------------------ ------------------------------
    checkedOn                      03/21/2013 15:51:11
    modifiedOn                     07/22/2013 14:04:55
    phoneNo                        9942251
    modifiedBy                     maker16
    
    --This filters the Name attribute in the path definition itself.
    
    SQL> with t as
      2  (
      3  select '
      4  
      5  
      6  
      7  
      8  
      9  ' as datacolumn
     10  FROM dual
     11  )
     12  select t1.newval
     13    from t
     14       , xmltable
     15         (
     16            '/changeinfo/property[@name="modifiedBy"]' passing xmltype(datacolumn)
     17            columns
     18              newval varchar2(100) path '@newvalue'
     19         ) t1;
    
    NEWVAL
    ------------------------------
    maker16
    

    And the $ 1 million question would be why VARCHAR2 type of XML data.

  • ALL_TAB_MODIFICATIONS contains all the database tables

    Hi all

    I try to use all_tab_modifications to get the date of last modification of some database tables.

    However, it is not all tables of database in this view.

    I made sure all the tables I want to get the last modified date have attribute Monitoring (surveillance = Yes)

    Please help me know what can be the reason of not containing not some of my tables of database in the views of all_tab_modifications or user_tab_modifications.

    Thank you in advance.

    A simple test that takes seconds will save you hours of speculation:

    orclz >

    orclz > select * from user_tab_modifications;

    no selected line

    orclz > delete from emp where rownum = 1;

    1 line removal.

    orclz > rollback;

    Complete restoration.

    orclz > dbms_stats.flush_database_monitoring_info exec.

    PL/SQL procedure successfully completed.

    orclz > select * from user_tab_modifications;

    TABLE-NAME

    ------------------------------

    NOM_PARTITION

    ------------------------------------------------------------------------------

    SUBPARTITION_NAME

    ------------------------------------------------------------------------------

    INSERTS DELETIONS TIMESTAMP TRU DROP_SEGMENTS UPDATES

    ---------- ---------- ---------- ------------------- --- -------------

    EMP

    0 0 1 2014-09-16 10:20:31 NO. 0

    orclz > dbms_stats.gather_table_stats(user,'emp') exec

    PL/SQL procedure successfully completed.

    orclz > select * from user_tab_modifications;

    no selected line

    orclz >

Maybe you are looking for