Tables created with PHP 'while' function

Hi All,
I am new at this, so please be gentle.
I have written a page that uses the PHP "while" function, to
get data from a mysql database, and display it in a page.
I have enclosed the function within a table so that the
results are contained together, but when the next loop of data
comes, the next table is placed on top of the previous. If I just
return one item and don't group it in a table, the data is
displayed side by side (which is what I want).
I am after displaying images in two columns down the screen,
with there name under, both returned from a database.
Heres my code, which returns just a single column.
<?php
{while ($row = mysql_fetch_array($result, MYSQL_NUM))
{ ?> <table width="0"
align="center"><tr><td height="130" valign="top">
<div align="center"><a href="javascript:"
onClick="MM_openBrWindow('descriptions.php','','width=650,height=550')"><img
src="<?php echo $row[0]; ?>" alt="" name="" width="120"
height="120" border="0"></a></div>
<div align="center"><?php echo $row[1];
?></tr></table>
Any ideas???
Dan

Make sure that your database is up.
Try to connect by user internal password is oracle.
The internal user is synoym for sys user.
You have to create a seperate tablespace and then try to use that tablespace. Because default tablespace is system in which you might not have the permession to create a table.
Hope so this will work.
Nikhil
Vadodara

Similar Messages

  • How to fix tables created with wrong initial extents

    1.We have many tables which are created with very large intial extents. Is there a way to reduce or resize initial extent?
    2.When I export the *.dmp is about 200MG, but the tablespace is more than a gig full. Why is that?
    3.I have a table with about 300,000 rows and calculated the table size to be around 86M. Should I create the initial extent here to be around 100M?
    4.I tried to do alter table ExampleTable deallocate unused, but did not help why is that?
    OBJECT_NAME = EMP
    TOTAL_BLOCKS = 16296
    TOTAL_BYTES = 133496832
    UNUSED_BLOCKS = 4915
    UNUSED BYTES = 40263680
    LAST_USED_EXTENT_FILE_ID = 9
    LAST_USED_EXTENT_BLOCK_ID = 23250
    LAST_USED_BLOCK = 11381
    PL/SQL procedure successfully completed.
    SQL> analyze table ibs_spec_value compute statistics;
    Table analyzed.
    SQL> select empty_blocks, empty_blocks*8192 unused_bytes
    2 from dba_tables
    3 where table_name='IBS_SPEC_VALUE' and owner='SPEC';
    EMPTY_BLOCKS UNUSED_BYTES
    4915 40263680
    SQL> ALTER TABLE SPEC.IBS_SPEC_VALUE DEALLOCATE UNUSED;
    Table altered.
    SQL> select empty_blocks, empty_blocks*8192 unused_bytes
    2 from dba_tables
    3 where table_name='IBS_SPEC_VALUE' and owner='SPEC';
    EMPTY_BLOCKS UNUSED_BYTES
    4915 40263680
    Thank you,
    Avanti.

    1.We have many tables which are created with very large intial extents. Is there a way to reduce or resize initial extent?
    export/import and CTAS.
    2.When I export the *.dmp is about 200MG, but the tablespace is more than a gig full. Why is that?
    Probably it is due of inefficient on managing the objects, which are heavily taken by tables/indexes. Tables/indexes were created oversize than estimation of data size.
    3.I have a table with about 300,000 rows and calculated the table size to be around 86M. Should I create the initial extent here to be around 100M?
    Yes, it is possible. Usually split into 2-5 extents is better.
    4.I tried to do alter table ExampleTable deallocate unused, but did not help why is that?
    OBJECT_NAME = EMP
    TOTAL_BLOCKS = 16296
    TOTAL_BYTES = 133496832
    UNUSED_BLOCKS = 4915
    UNUSED BYTES = 40263680
    LAST_USED_EXTENT_FILE_ID = 9
    LAST_USED_EXTENT_BLOCK_ID = 23250
    LAST_USED_BLOCK = 11381
    PL/SQL procedure successfully completed.
    SQL> analyze table ibs_spec_value compute statistics;
    Table analyzed.
    SQL> select empty_blocks, empty_blocks*8192 unused_bytes
    2 from dba_tables
    3 where table_name='IBS_SPEC_VALUE' and owner='SPEC';
    EMPTY_BLOCKS UNUSED_BYTES
    4915 40263680
    SQL> ALTER TABLE SPEC.IBS_SPEC_VALUE DEALLOCATE UNUSED;
    Table altered.
    SQL> select empty_blocks, empty_blocks*8192 unused_bytes
    2 from dba_tables
    3 where table_name='IBS_SPEC_VALUE' and owner='SPEC';
    EMPTY_BLOCKS UNUSED_BYTES
    4915 40263680
    The next paragraph is guoted from Oracle documentation :
    "Use the deallocate_unused_clause to explicitly deallocate unused space at the end of the table, partition or subpartition, overflow data segment, LOB data segment, or LOB index and makes the space available for other segments in the tablespace. You can free only unused space above the high water mark (that is, the point beyond which database blocks have not yet been formatted to receive data)".
    Most probably on your case there is no unused block over the last used block on this table. So the deallocate function doesn't give any effect. As you described, the last used block is 11381 which is get from TOTAL_BLOCKS minus UNUSED_BLOCKS.

  • Tables created with weird names

    I ran some insert scripts on a 10g oracle db and found that some tables have been created with wierd names like 'BIN$+2KAmAoPTKO5tzd9l1bmBQ==$0' . I could not even rename/drop these tables. I get the error message
    "ORA-27235: Message 27235 not found; product=RDBMS; facility=ORA
    if someone has encountered this prob before please help..

    They're already deleted tables....
    Oracle 10g has a recycle bin, where deleted tables are not actually deleted.
    You have to run a command ( think it's "purge recyclebin" ) to delete them permanantly.
    regards,
    Owen

  • My webpage created with php prints code instead of the created webpage

    My webpage is created using dynamic field therefore it had to be save as .php.
    The problem now is when i want to print the page it prints code instead of the actual page. Is the a solution for this problem?
    Here is the site
    http://www.pianoandkeyboardshoponline.co.uk/Test/
    Any help welcome

    I think you're confused by what you're seeing.
    When I print > preview your on-line page in Firefox, I see the page content and links -- which may look like code to you, but they're not revealing anything abnormal.   These are just links to other pages.
    detailed_page.php?product_id=307-Yamaha-P105-Digital-Piano-in-White
    You have these external style sheets but they are designated for screen & projection media only.
    <link rel="stylesheet" type="text/css" media="screen, projection" href="style.css" />
    <link rel="stylesheet" type="text/css" media="screen, projection" href="jcart/css/jcart.css" />
    Your print styles are actually driven by boilerplate.css towards the bottom of the page.
    /* ==|== print styles =======================================================
       Print styles.
       Inlined to avoid required HTTP connection: h5bp.com/r
       ========================================================================== */
    @media print {
      * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */
      a, a:visited { text-decoration: underline; }
      a[href]:after { content: " (" attr(href) ")"; }
      abbr[title]:after { content: " (" attr(title) ")"; }
      .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }  /* Don't show links for images, or javascript/internal links */
      pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
      thead { display: table-header-group; } /* h5bp.com/t */
      tr, img { page-break-inside: avoid; }
      img { max-width: 100% !important; }
      @page { margin: 0.5cm; }
      p, h2, h3 { orphans: 3; widows: 3; }
      h2, h3 { page-break-after: avoid; }
    Perhaps that's why what you see in print doesn't match what you see on screen.
    If you want a print out of the screen display, do a screengrab with your print screen key.  Paste content it into your favorite graphics editor.
    Hope this helps,
    Nancy O.

  • How could i updated a table created with 5 tables.

    Hi everyone,
    This is my problem. I have five "tables" and each one contains one row and 7 columns. In the other hand, I have one table(Ireland1) that it retrieves the values of these 5 "tables" through of " insert into" statement.
    How would be I able to update of "Ireland1" data, when one of this "tables" (Remenber, I have 5 tables)  has changed?
    I have been searching information about this but  all my search has been fruitless.
    Thanks in advance,
    From Ireland

    Hi Eric,
    Thank you for your quick reply and solution. I have run your statement and appear this error:
    Msg 156, Level 15, State 1, Procedure Non_current_assets_Historic_View, Line 426
    Incorrect syntax near the keyword 'SELECT'.
    I dont know why this error appear
    I leave my Sript practically full
    USE Aerospace
    GO
    --TABLE NON-CURRENT ASSETS
    IF OBJECT_ID('Non_current_assets_Historic') IS NOT NULL
    DROP TABLE Non_current_assets_Historic
    GO
    CREATE TABLE Non_current_assets_Historic
    [IdCuenta] [float] NOT NULL,
    [NameCuenta] [nvarchar](255) NULL,
    Year_2006 decimal (14,2) NULL,
    Year_2007 decimal (14,2) NULL,
    Year_2008 decimal (14,2) NULL,
    Year_2009 decimal (14,2) NULL,
    Year_2010 decimal (14,2) NULL,
    Year_2011 decimal (14,2) NULL,
    Year_2012 decimal (14,2) NULL,
    Year_2013 decimal (14,2) NULL,
    Year_2014 decimal (14,2) NULL,
    Dif_2007_2006 decimal (14,2) NULL,
    Dif_2008_2007 decimal (14,2) NULL,
    Dif_2009_2008 decimal (14,2) NULL,
    Dif_2010_2009 decimal (14,2) NULL,
    Dif_2011_2010 decimal (14,2) NULL,
    Dif_2012_2011 decimal (14,2) NULL,
    Dif_2013_2012 decimal (14,2) NULL,
    Dif_2014_2013 decimal (14,2) NULL,
    AHP_2007_2006 decimal (14,2) NULL,
    AHP_2008_2007 decimal (14,2) NULL,
    AHP_2009_2008 decimal (14,2) NULL,
    AHP_2010_2009 decimal (14,2) NULL,
    AHP_2011_2010 decimal (14,2) NULL,
    AHP_2012_2011 decimal (14,2) NULL,
    AHP_2013_2012 decimal (14,2) NULL,
    AHP_2014_2013 decimal (14,2) NULL,
    GO
    ALTER TABLE Non_current_assets_Historic
    ADD CONSTRAINT PK_Non_current_assets_Historic PRIMARY KEY (IdCuenta)
    GO
    UPDATE Non_current_assets_Historic SET Year_2006=0 WHERE Year_2006 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2007=0 WHERE Year_2007 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2008=0 WHERE Year_2008 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2009=0 WHERE Year_2009 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2010=0 WHERE Year_2010 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2011=0 WHERE Year_2011 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2012=0 WHERE Year_2012 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2013=0 WHERE Year_2013 IS NULL
    UPDATE Non_current_assets_Historic SET Year_2014=0 WHERE Year_2014 IS NULL
    GO
    INSERT INTO Non_current_assets_Historic
    SELECT *
    FROM Property_plant_equipment_Historic
    INSERT INTO Non_current_assets_Historic
    SELECT *
    FROM Intangible_assets_Historic
    INSERT INTO Non_current_assets_Historic
    SELECT *
    FROM Available_financial_assets_Historic
    INSERT INTO Non_current_assets_Historic
    SELECT *
    FROM Deferred_tax_assets_Historic
    INSERT INTO Non_current_assets_Historic
    SELECT *
    FROM Deposits_restricted_12M_Historic
    GO
    --SUMATORIO YEAR 2006
    Declare @Cantidad20061 decimal (14,2)
    Declare @Cantidad20062 decimal (14,2)
    Declare @Cantidad20063 decimal (14,2)
    Declare @Cantidad20064 decimal (14,2)
    Declare @Cantidad20065 decimal (14,2)
    Select @Cantidad20061 = Year_2006 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad20062 = Year_2006 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad20063 = Year_2006 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad20064 = Year_2006 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad20065 = Year_2006 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2007
    Declare @Cantidad20071 decimal (14,2)
    Declare @Cantidad20072 decimal (14,2)
    Declare @Cantidad20073 decimal (14,2)
    Declare @Cantidad20074 decimal (14,2)
    Declare @Cantidad20075 decimal (14,2)
    Select @Cantidad20071 = Year_2007 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad20072 = Year_2007 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad20073 = Year_2007 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad20074 = Year_2007 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad20075 = Year_2007 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2008
    Declare @Cantidad20081 decimal (14,2)
    Declare @Cantidad20082 decimal (14,2)
    Declare @Cantidad20083 decimal (14,2)
    Declare @Cantidad20084 decimal (14,2)
    Declare @Cantidad20085 decimal (14,2)
    Select @Cantidad20081 = Year_2008 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad20082 = Year_2008 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad20083 = Year_2008 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad20084 = Year_2008 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad20085 = Year_2008 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2009
    Declare @Cantidad20091 decimal (14,2)
    Declare @Cantidad20092 decimal (14,2)
    Declare @Cantidad20093 decimal (14,2)
    Declare @Cantidad20094 decimal (14,2)
    Declare @Cantidad20095 decimal (14,2)
    Select @Cantidad20091 = Year_2009 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad20092 = Year_2009 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad20093 = Year_2009 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad20094 = Year_2009 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad20095 = Year_2009 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2010
    Declare @Cantidad200101 decimal (14,2)
    Declare @Cantidad200102 decimal (14,2)
    Declare @Cantidad200103 decimal (14,2)
    Declare @Cantidad200104 decimal (14,2)
    Declare @Cantidad200105 decimal (14,2)
    Select @Cantidad200101 = Year_2010 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad200102 = Year_2010 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad200103 = Year_2010 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad200104 = Year_2010 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad200105 = Year_2010 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2011
    Declare @Cantidad200111 decimal (14,2)
    Declare @Cantidad200112 decimal (14,2)
    Declare @Cantidad200113 decimal (14,2)
    Declare @Cantidad200114 decimal (14,2)
    Declare @Cantidad200115 decimal (14,2)
    Select @Cantidad200111 = Year_2011 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad200112 = Year_2011 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad200113 = Year_2011 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad200114 = Year_2011 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad200115 = Year_2011 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2012
    Declare @Cantidad200121 decimal (14,2)
    Declare @Cantidad200122 decimal (14,2)
    Declare @Cantidad200123 decimal (14,2)
    Declare @Cantidad200124 decimal (14,2)
    Declare @Cantidad200125 decimal (14,2)
    Select @Cantidad200121 = Year_2012 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad200122 = Year_2012 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad200123 = Year_2012 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad200124 = Year_2012 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad200125 = Year_2012 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2013
    Declare @Cantidad200131 decimal (14,2)
    Declare @Cantidad200132 decimal (14,2)
    Declare @Cantidad200133 decimal (14,2)
    Declare @Cantidad200134 decimal (14,2)
    Declare @Cantidad200135 decimal (14,2)
    Select @Cantidad200131 = Year_2013 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad200132 = Year_2013 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad200133 = Year_2013 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad200134 = Year_2013 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad200135 = Year_2013 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO YEAR 2014
    Declare @Cantidad200141 decimal (14,2)
    Declare @Cantidad200142 decimal (14,2)
    Declare @Cantidad200143 decimal (14,2)
    Declare @Cantidad200144 decimal (14,2)
    Declare @Cantidad200145 decimal (14,2)
    Select @Cantidad200141 = Year_2014 from Non_current_assets_Historic where IdCuenta ='7'
    Select @Cantidad200142 = Year_2014 from Non_current_assets_Historic where IdCuenta ='8'
    Select @Cantidad200143 = Year_2014 from Non_current_assets_Historic where IdCuenta ='9'
    Select @Cantidad200144 = Year_2014 from Non_current_assets_Historic where IdCuenta ='10'
    Select @Cantidad200145 = Year_2014 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2007_2006
    Declare @DIF_2007_20061 decimal (14,2)
    Declare @DIF_2007_20062 decimal (14,2)
    Declare @DIF_2007_20063 decimal (14,2)
    Declare @DIF_2007_20064 decimal (14,2)
    Declare @DIF_2007_20065 decimal (14,2)
    Select @DIF_2007_20061 = Dif_2007_2006 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2007_20062 = Dif_2007_2006 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2007_20063 = Dif_2007_2006 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2007_20064 = Dif_2007_2006 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2007_20065 = Dif_2007_2006 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2008_2007
    Declare @DIF_2008_20071 decimal (14,2)
    Declare @DIF_2008_20072 decimal (14,2)
    Declare @DIF_2008_20073 decimal (14,2)
    Declare @DIF_2008_20074 decimal (14,2)
    Declare @DIF_2008_20075 decimal (14,2)
    Select @DIF_2008_20071 = Dif_2008_2007 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2008_20072 = Dif_2008_2007 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2008_20073 = Dif_2008_2007 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2008_20074 = Dif_2008_2007 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2008_20075 = Dif_2008_2007 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2009_2008
    Declare @DIF_2009_20081 decimal (14,2)
    Declare @DIF_2009_20082 decimal (14,2)
    Declare @DIF_2009_20083 decimal (14,2)
    Declare @DIF_2009_20084 decimal (14,2)
    Declare @DIF_2009_20085 decimal (14,2)
    Select @DIF_2009_20081 = Dif_2009_2008 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2009_20082 = Dif_2009_2008 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2009_20083 = Dif_2009_2008 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2009_20084 = Dif_2009_2008 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2009_20085 = Dif_2009_2008 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2010_2009
    Declare @DIF_2010_20091 decimal (14,2)
    Declare @DIF_2010_20092 decimal (14,2)
    Declare @DIF_2010_20093 decimal (14,2)
    Declare @DIF_2010_20094 decimal (14,2)
    Declare @DIF_2010_20095 decimal (14,2)
    Select @DIF_2010_20091 = Dif_2010_2009 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2010_20092 = Dif_2010_2009 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2010_20093 = Dif_2010_2009 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2010_20094 = Dif_2010_2009 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2010_20095 = Dif_2010_2009 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2011_2010
    Declare @DIF_2011_20101 decimal (14,2)
    Declare @DIF_2011_20102 decimal (14,2)
    Declare @DIF_2011_20103 decimal (14,2)
    Declare @DIF_2011_20104 decimal (14,2)
    Declare @DIF_2011_20105 decimal (14,2)
    Select @DIF_2011_20101 = Dif_2011_2010 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2011_20102 = Dif_2011_2010 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2011_20103 = Dif_2011_2010 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2011_20104 = Dif_2011_2010 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2011_20105 = Dif_2011_2010 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2012_2011
    Declare @DIF_2012_20111 decimal (14,2)
    Declare @DIF_2012_20112 decimal (14,2)
    Declare @DIF_2012_20113 decimal (14,2)
    Declare @DIF_2012_20114 decimal (14,2)
    Declare @DIF_2012_20115 decimal (14,2)
    Select @DIF_2012_20111 = Dif_2012_2011 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2012_20112 = Dif_2012_2011 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2012_20113 = Dif_2012_2011 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2012_20114 = Dif_2012_2011 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2012_20115 = Dif_2012_2011 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2013_2012
    Declare @DIF_2013_20121 decimal (14,2)
    Declare @DIF_2013_20122 decimal (14,2)
    Declare @DIF_2013_20123 decimal (14,2)
    Declare @DIF_2013_20124 decimal (14,2)
    Declare @DIF_2013_20125 decimal (14,2)
    Select @DIF_2013_20121 = Dif_2013_2012 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2013_20122 = Dif_2013_2012 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2013_20123 = Dif_2013_2012 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2013_20124 = Dif_2013_2012 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2013_20125 = Dif_2013_2012 from Non_current_assets_Historic where IdCuenta ='11'
    --SUMATORIO DIF_2014_2013
    Declare @DIF_2014_20131 decimal (14,2)
    Declare @DIF_2014_20132 decimal (14,2)
    Declare @DIF_2014_20133 decimal (14,2)
    Declare @DIF_2014_20134 decimal (14,2)
    Declare @DIF_2014_20135 decimal (14,2)
    Select @DIF_2014_20131 = Dif_2014_2013 from Non_current_assets_Historic where IdCuenta ='7'
    Select @DIF_2014_20132 = Dif_2014_2013 from Non_current_assets_Historic where IdCuenta ='8'
    Select @DIF_2014_20133 = Dif_2014_2013 from Non_current_assets_Historic where IdCuenta ='9'
    Select @DIF_2014_20134 = Dif_2014_2013 from Non_current_assets_Historic where IdCuenta ='10'
    Select @DIF_2014_20135 = Dif_2014_2013 from Non_current_assets_Historic where IdCuenta ='11'
    insert into Non_current_assets_Historic (IdCuenta,NameCuenta,Year_2006 , Year_2007,Year_2008 ,Year_2009 ,Year_2010,Year_2011 ,Year_2012 ,Year_2013 ,
    Year_2014,Dif_2007_2006,Dif_2008_2007, Dif_2009_2008, Dif_2010_2009,Dif_2011_2010,Dif_2012_2011,Dif_2013_2012,Dif_2014_2013,
    AHP_2007_2006, AHP_2008_2007 , AHP_2009_2008, AHP_2010_2009, AHP_2011_2010, AHP_2012_2011 , AHP_2013_2012,AHP_2014_2013 )
    Values (1, 'Non-current assets', NULL,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll),
    (19, '', NULL,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll,NUll),
    (20, 'Total Non-current assets',
    --Year_2006
    (@Cantidad20061 +@Cantidad20062 +@Cantidad20063 +@Cantidad20064 +@Cantidad20065),
    --Year_2007
    (@Cantidad20071+ @Cantidad20072 + @Cantidad20073+ @Cantidad20074+ @Cantidad20075),
    --Year_2008
    (@Cantidad20081 + @Cantidad20082 + @Cantidad20083 + @Cantidad20084 + @Cantidad20085),
    --Year_2009
    (@Cantidad20091 + @Cantidad20092 + @Cantidad20093+ @Cantidad20094 + @Cantidad20095),
    --Year_2010
    (@Cantidad200101 + @Cantidad200102 + @Cantidad200103 + @Cantidad200104 + @Cantidad200105),
    --Year_2011
    (@Cantidad200111 + @Cantidad200112 + @Cantidad200113 + @Cantidad200114 + @Cantidad200115),
    --Year_2012
    (@Cantidad200121 + @Cantidad200122 + @Cantidad200123 +@Cantidad200124 + @Cantidad200125),
    --Year_2013
    (@Cantidad200131 + @Cantidad200132 +@Cantidad200133 + @Cantidad200134 + @Cantidad200135),
    --Year_2014
    (@Cantidad200141 + @Cantidad200142 + @Cantidad200143 + @Cantidad200144 + @Cantidad200145),
    --Diferencia Numeria 2007-2006
    (@DIF_2007_20061 + @DIF_2007_20062 + @DIF_2007_20063 + @DIF_2007_20064 + @DIF_2007_20065),
    --Diferencia Numeria 2008-2007
    (@DIF_2008_20071 + @DIF_2008_20072 + @DIF_2008_20073 + @DIF_2008_20074 + @DIF_2008_20075),
    --Diferencia Numeria 2009-2008
    (@DIF_2009_20081 + @DIF_2009_20082 + @DIF_2009_20083 + @DIF_2009_20084 + @DIF_2009_20085 ),
    --Diferencia Numeria 2010-2009
    (@DIF_2010_20091 + @DIF_2010_20092 + @DIF_2010_20093 + @DIF_2010_20094 + @DIF_2010_20095),
    --Diferencia Numeria 2011-2006
    (@DIF_2011_20101 + @DIF_2011_20102 + @DIF_2011_20103 +@DIF_2011_20104 + @DIF_2011_20105 ),
    --Diferencia Numeria 2012-2011
    (@DIF_2012_20111+@DIF_2012_20112+@DIF_2012_20113+@DIF_2012_20114+@DIF_2012_20115),
    --Diferencia Numeria 2013-2012
    (@DIF_2013_20121 + @DIF_2013_20122 +@DIF_2013_20123 +@DIF_2013_20124 + @DIF_2013_20125),
    --Diferencia Numeria 2014-2013
    (@DIF_2014_20131+@DIF_2014_20132+@DIF_2014_20133+@DIF_2014_20134+@DIF_2014_20135),
    --Diferencia Porcentual 2007-2006
    (@DIF_2007_20061+@DIF_2007_20062+@DIF_2007_20063+@DIF_2007_20064+@DIF_2007_20065)/(@Cantidad20061 +@Cantidad20062 +@Cantidad20063 +@Cantidad20064 +@Cantidad20065),
    --Diferencia Porcentual 2008-2007
    (@DIF_2008_20071 + @DIF_2008_20072 + @DIF_2008_20073 + @DIF_2008_20074 + @DIF_2008_20075)/(@Cantidad20071+ @Cantidad20072 + @Cantidad20073+ @Cantidad20074+ @Cantidad20075),
    --Diferencia Porcentual 2009-2008
    (@DIF_2009_20081 + @DIF_2009_20082 + @DIF_2009_20083 + @DIF_2009_20084 + @DIF_2009_20085 )/(@Cantidad20081 + @Cantidad20082 + @Cantidad20083 + @Cantidad20084 + @Cantidad20085),
    --Diferencia Porcentual 2010-2009
    (@DIF_2010_20091 + @DIF_2010_20092 + @DIF_2010_20093 + @DIF_2010_20094 + @DIF_2010_20095)/(@Cantidad20091 + @Cantidad20092 + @Cantidad20093+ @Cantidad20094 + @Cantidad20095),
    --Diferencia Porcentual 2011-2010
    (@DIF_2011_20101 + @DIF_2011_20102 + @DIF_2011_20103 +@DIF_2011_20104 + @DIF_2011_20105)/(@Cantidad200101 + @Cantidad200102 + @Cantidad200103 + @Cantidad200104 + @Cantidad200105),
    --Diferencia Porcentual 2012-2011
    (@DIF_2012_20111+@DIF_2012_20112+@DIF_2012_20113+@DIF_2012_20114+@DIF_2012_20115)/(@Cantidad200111 + @Cantidad200112 + @Cantidad200113 + @Cantidad200114 + @Cantidad200115),
    --Diferencia Porcentual 2013-2012
    (@DIF_2013_20121 + @DIF_2013_20122 +@DIF_2013_20123 +@DIF_2013_20124 + @DIF_2013_20125)/(@Cantidad200121 + @Cantidad200122 + @Cantidad200123 +@Cantidad200124 + @Cantidad200125),
    --Diferencia Porcentual 2014-2013
    (@DIF_2014_20131+@DIF_2014_20132+@DIF_2014_20133+@DIF_2014_20134+@DIF_2014_20135)/(@Cantidad200131 + @Cantidad200132 +@Cantidad200133 + @Cantidad200134 + @Cantidad200135))
    GO
    SELECT IdCuenta ,NameCuenta ,Year_2006 ,Year_2007 ,Year_2008 ,Year_2009 ,Year_2010 ,Year_2011 ,Year_2012 , Year_2013 ,Year_2014
    FROM Non_current_assets_Historic
    Maybe the error is in the design
    of this table
    Regards
    Francisco
    I work with SQL 2014 Management Studio

  • How to perform CRUD operations on joined tables created with Fluent API on Azure Mobile Services?

    I've been following the
    Field Engineer example project from the Windows Development Center to guide into mapping many-to-many relationships on my model. What's been bothering me is how to insert entries into many-to-many relationships.
    Take my model as example:
    An Organization can have many Users.
    An User can belong to many Organizations.
    My model class for User looks like this:
    public class User
    public User()
    this.Organizations = new HashSet<Organization>();
    public int Id { get; set; }
    public string Email { get; set; }
    public string Password { get; set; }
    public string PasswordSalt { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public bool Active { get; set; }
    public string Picture { get; set; }
    public string PictureMimeType { get; set; }
    public bool Confirmed { get; set; }
    public string ConfirmationKey { get; set; }
    [JsonIgnore]
    public virtual ICollection<Organization> Organizations { get; set; }
    My UserDTO class is this:
    public class UserDTO : EntityData
    public string Email { get; set; }
    public string Password { get; set; }
    public string PasswordSalt { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public bool Active { get; set; }
    public string Picture { get; set; }
    public string PictureMimeType { get; set; }
    public bool Confirmed { get; set; }
    public string ConfirmationKey { get; set; }
    My Organization class:
    public class Organization
    public Organization()
    this.Users = new List<User>();
    public string Id { get; set; }
    public string Title { get; set; }
    public string LegalName { get; set; }
    public string TaxReference { get; set; }
    [JsonIgnore]
    public virtual ICollection<User> Users { get; set; }
    My OrganizationDTO class:
    public class OrganizationDTO : EntityData
    public string Title { get; set; }
    public string LegalName { get; set; }
    public string TaxReference { get; set; }
    public virtual ICollection<UserDTO> Users { get; set; }
    With those classes in mind I created the controller classes, I mapped the DTO and the Model classes using AutoMapper as follows:
    cfg.CreateMap<Organization, OrganizationDTO>()
    .ForMember(organizationDTO => organizationDTO.Id,
    map => map.MapFrom(organization => MySqlFuncs.LTRIM(MySqlFuncs.StringConvert(organization.Id))))
    .ForMember(organizationDTO => organizationDTO.Users,
    map => map.MapFrom(organization => organization.Users));
    cfg.CreateMap<OrganizationDTO, Organization>()
    .ForMember(organization => organization.Id,
    map => map.MapFrom(organizationDTO => MySqlFuncs.LongParse(organizationDTO.Id)))
    .ForMember(organization => organization.Users,
    map => map.Ignore());
    Using Fluent API, I defined the relationship between these two entities using an EntityTypeConfiguration class like this:
    public class UserEntityConfiguration : EntityTypeConfiguration<User>
    public UserEntityConfiguration()
    this.Property(u => u.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
    this.HasMany<Organization>(u => u.Organizations).WithMany(o => o.Users).Map(uo =>
    uo.MapLeftKey("UserId");
    uo.MapRightKey("OrganizationId");
    uo.ToTable("OrganizationsUsers");
    I created a TableController class to handle UserDTO and OrganizationDTO, I have no problem inserting new Users or new Organizations, but the endpoints from each TableController class only allows me to add Users or Organizations individually as far as I understand.
    To create an entry into the OrganizationsUser table, how can I achieve this?
    I was thinking a PATCH request should be a way to do this, but is it the right way? Do I have to define a TableController for this? How can I expose the Insert, Update, Select and Delete operation for the elements in this relationship? What would be the JSON
    to be sent to the endpoints?

    Hi,
    if you accept lists to hold the LOV data, then here is an example : http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples --> sample 70
    Frank

  • Creating a pivot table view with two levels of headers

    Hi,
    I have a requirement in which i need to have a common heading for two or more columns.
    For Example, I have two columns like total number of loans and Total loan amount. As per my requirement, i need to give a common header 'Total loan' as the main header and amount and Count as two subheaders under the main heading in the pivot table.
    In table view, i would be able to make it using the display column and table header property. But, i need to get the same in pivot table as we have to use pivot table view instead of table view.
    Please Help me on this issue.
    Thanks in Advance
    Deepak

    Hello,
    create one column in criteria and change it's fx to case when 1=0 then Products."Prod Name" else 'Tota Loanl' end
    Now go to pivot and drag this column to Columns block of pivot. But keep this column up of Measure Labels and Now, go to column Format values.
    Mention cell horizontal alignment to Center
    see the following screenshot, Header is the column i created with the above functionality.
    !http://i852.photobucket.com/albums/ab83/kishorg86/Header.jpg!

  • PHP mail() function not working

    Hello, I am having a problem sending mail with php while hosting my own website with apache on my mac. First of all I would like to note that I do not have a large background with web hosting and php. Everything that I did so far was just suggestions from online articles and other forums, so please include detail with any answers.
    I have apache started, and my website hosted just fine. I can also view php pages so I know php is running too. My problem is using the php mail() function.
    I have a simple form in my site who's action attribute is set to results.php. In the results.php file I have the mail() function (along with html code displaying "thank you...blah blah blah") sending info from the form to my email address. I never get an error on the php side, but my mail never gets sent.
    Is there some type of setting in a config file that need to be turned on or changed?
    Here is what I have done/modified so far from my research from online articles. i dont know what some of them mean, but followed the steps correctly:
    Edited the /etc/hostconfig file and added the line MAILSERVER=-YES-
    Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes)
    Edited the php.ini file to the following - The line under where it says
    ; For unix only. You may supply arguments as well (default: "sendmail -t -i")
    Sendmail_path = usr/sbin/sendmail -t -i
    I opened the mail.log file and here are some entries from the other day:
    Code:
    Jul 9 08:16:50 new-host postfix/master[689]: daemon started -- version 2.4.3, configuration /etc/postfix
    Jul 9 08:16:50 new-host postfix/qmgr[691]: 4B4DC2E8331: from=<[email protected]>, size=323, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: 7A8242EE3C0: from=<[email protected]>, size=280, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: B1C052EE3C4: from=<[email protected]>, size=280, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: C281C2EE3C5: from=<[email protected]>, size=327, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/smtp[694]: 4B4DC2E8331: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=213262, delays=213261/0.05/0.86/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/pickup[690]: 0F5D22EE4DB: uid=70 from=<_www>
    Jul 9 08:16:51 new-host postfix/cleanup[692]: 0F5D22EE4DB: message-id=<20100709121651.0F5D22EE4DB@localhost>
    Jul 9 08:16:51 new-host postfix/qmgr[691]: 0F5D22EE4DB: from=<[email protected]>, size=333, nrcpt=1 (queue active)
    Jul 9 08:16:51 new-host postfix/smtp[695]: 7A8242EE3C0: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27074, delays=27073/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/smtp[697]: C281C2EE3C5: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=26817, delays=26816/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/smtp[696]: B1C052EE3C4: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27174, delays=27173/0.01/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:17:23 new-host postfix/smtp[694]: connect to mx1.comcast.net[76.96.62.116]: Operation timed out (port 25)
    Jul 9 08:17:50 new-host postfix/master[689]: master exit time has arrived
    Any other suggestions on how to get this to work? I have also created a simple php file that sends mail without retreiving info from a form and also tried using several different email addresses to send to and from, but still nothing

    Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes) Change that to mail.yourispname.com Then run sudo postfix reload and see if it sends mail. The reason being, is that you don't have a fully qualified domain name.
    And make that reflective in your mail() function file/template.
    Message was edited by: doug pennington

  • Need help with PHP mail script

    I  have created a  log in system  . In that when the  user completes the  registration process an auto reply(auto-reply@domain)  will generate and  sent this to users email id regarding about the user  name and password  (Lo gin Details). After formal approval from the admin  the user will  get a user activation mail with log in link.
    But , my problem is  these are work only for mail accounts from my  domain  only(test@domain). its not send any of above mentioned details  to other  mail services like gmail or yahoo etc.
    i discussed this   with some others, they said its the problem with your mail function   configuration. but i didn't get any needful information as am a  beginner  in PHP scripting.
    i have contacted this with my  hosting service they said its the  problem with  php mail () function  and use php mailer() instead mail().
    please give me a solution for the same..
    Here am ataching my code..
    <?php
    include 'dbc.php';
    $err = array();
    if($_POST['doRegister'] == 'Register')
    foreach($_POST as $key => $value) {
        $data[$key] = filter($value);
    if(empty($data['full_name']) || strlen($data['full_name']) < 4)
    $err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate User Name
    if (!isUserID($data['user_name'])) {
    $err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate Email
    if(!isEmail($data['usr_email'])) {
    $err[] = "ERROR - Invalid email address.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Check User Passwords
    if (!checkPwd($data['pwd'],$data['pwd2'])) {
    $err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
    //header("Location: register.php?msg=$err");
    //exit();
    $user_ip = $_SERVER['REMOTE_ADDR'];
    // stores sha1 of password
    $sha1pass = PwdHash($data['pwd']);
    // Automatically collects the hostname or domain  like example.com)
    $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    // Generates activation code simple 4 digit number
    $activ_code = rand(1000,9999);
    $usr_email = $data['usr_email'];
    $user_name = $data['user_name'];
    $rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
    list($total) = mysql_fetch_row($rs_duplicate);
    if ($total > 0)
    $err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
    if(empty($err)) {
    $sql_insert = "INSERT into `users`
                  (`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
                VALUES
                ('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
                ,now(),'$user_ip','$activ_code','$data[country]','$user_name'
    mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
    $user_id = mysql_insert_id($link); 
    $md5_id = md5($user_id);
    mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
    //    echo "<h3>Thank You</h3> We received your submission.";
    if($user_registration)  {
    $a_link = "
    *****ACTIVATION LINK*****\n
    http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
    } else {
    $a_link =
    "Your account is *PENDING APPROVAL* and will be soon activated the administrator.
    $message =
    "Hello \n
    Thank you for registering with us. Here are your login details...\n
    User ID: $user_name
    Email: $usr_email \n
    Passwd: $data[pwd] \n
    $a_link
    Thank You
    Administrator
    $host_upper
    THIS IS AN AUTOMATED RESPONSE.
    ***DO NOT RESPOND TO THIS EMAIL****
        mail($usr_email, "Login Details", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());
      header("Location: thankyou.php"); 
      exit();
    ?>

    I  have created a  log in system  . In that when the  user completes the  registration process an auto reply(auto-reply@domain)  will generate and  sent this to users email id regarding about the user  name and password  (Lo gin Details). After formal approval from the admin  the user will  get a user activation mail with log in link.
    But , my problem is  these are work only for mail accounts from my  domain  only(test@domain). its not send any of above mentioned details  to other  mail services like gmail or yahoo etc.
    i discussed this   with some others, they said its the problem with your mail function   configuration. but i didn't get any needful information as am a  beginner  in PHP scripting.
    i have contacted this with my  hosting service they said its the  problem with  php mail () function  and use php mailer() instead mail().
    please give me a solution for the same..
    Here am ataching my code..
    <?php
    include 'dbc.php';
    $err = array();
    if($_POST['doRegister'] == 'Register')
    foreach($_POST as $key => $value) {
        $data[$key] = filter($value);
    if(empty($data['full_name']) || strlen($data['full_name']) < 4)
    $err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate User Name
    if (!isUserID($data['user_name'])) {
    $err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate Email
    if(!isEmail($data['usr_email'])) {
    $err[] = "ERROR - Invalid email address.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Check User Passwords
    if (!checkPwd($data['pwd'],$data['pwd2'])) {
    $err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
    //header("Location: register.php?msg=$err");
    //exit();
    $user_ip = $_SERVER['REMOTE_ADDR'];
    // stores sha1 of password
    $sha1pass = PwdHash($data['pwd']);
    // Automatically collects the hostname or domain  like example.com)
    $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    // Generates activation code simple 4 digit number
    $activ_code = rand(1000,9999);
    $usr_email = $data['usr_email'];
    $user_name = $data['user_name'];
    $rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
    list($total) = mysql_fetch_row($rs_duplicate);
    if ($total > 0)
    $err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
    if(empty($err)) {
    $sql_insert = "INSERT into `users`
                  (`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
                VALUES
                ('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
                ,now(),'$user_ip','$activ_code','$data[country]','$user_name'
    mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
    $user_id = mysql_insert_id($link); 
    $md5_id = md5($user_id);
    mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
    //    echo "<h3>Thank You</h3> We received your submission.";
    if($user_registration)  {
    $a_link = "
    *****ACTIVATION LINK*****\n
    http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
    } else {
    $a_link =
    "Your account is *PENDING APPROVAL* and will be soon activated the administrator.
    $message =
    "Hello \n
    Thank you for registering with us. Here are your login details...\n
    User ID: $user_name
    Email: $usr_email \n
    Passwd: $data[pwd] \n
    $a_link
    Thank You
    Administrator
    $host_upper
    THIS IS AN AUTOMATED RESPONSE.
    ***DO NOT RESPOND TO THIS EMAIL****
        mail($usr_email, "Login Details", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());
      header("Location: thankyou.php"); 
      exit();
    ?>

  • Rotate Image Created with createImage() ?

    I've been looking around online for a way to do this, but so far the only things I have found are 50+ lines of code. Surely there is a simple way to rotate an image created with the createImage() function?
    Here's some example code with all the tedious stuff already written. Can someone show me a simple way to rotate my image?
    import java.net.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class RotImg extends JApplet implements MouseListener {
              URL base;
              MediaTracker mt;
              Image myimg;
         public void init() {
              try{ mt = new MediaTracker(this);
                   base = getCodeBase(); }
              catch(Exception ex){}
              myimg = getImage(base, "myimg.gif");
              mt.addImage(myimg, 1);
              try{ mt.waitForAll(); }
              catch(Exception ex){}
              this.addMouseListener(this);
         public void paint(Graphics g){
              super.paint(g);
              Graphics2D g2 = (Graphics2D) g;
              g2.drawImage(myimg, 20, 20, this);
         public void mouseClicked(MouseEvent e){
              //***** SOME CODE HERE *****//
              // Rotate myimg by 5 degrees
              //******** END CODE ********//
              repaint();
         public void mouseEntered(MouseEvent e){}
         public void mouseExited(MouseEvent e){}
         public void mousePressed(MouseEvent e){}
         public void mouseReleased(MouseEvent e){}
    }Thanks very much for your help!
    null

    //  <applet code="RotationApplet" width="400" height="400"></applet>
    //  use: >appletviewer RotationApplet.java
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class RotationApplet extends JApplet {
        RotationAppletPanel rotationPanel;
        public void init() {
            Image image = loadImage();
            rotationPanel = new RotationAppletPanel(image);
            setLayout(new BorderLayout());
            getContentPane().add(rotationPanel);
        private Image loadImage() {
            String path = "images/cougar.jpg";
            Image image = getImage(getCodeBase(), path);
            MediaTracker mt = new MediaTracker(this);
            mt.addImage(image, 0);
            try {
                mt.waitForID(0);
            } catch(InterruptedException e) {
                System.out.println("loading interrupted");
            return image;
    class RotationAppletPanel extends JPanel {
        BufferedImage image;
        double theta = 0;
        final double thetaInc = Math.toRadians(5.0);
        public RotationAppletPanel(Image img) {
            image = convert(img);
            addMouseListener(ml);
        public void rotate() {
            theta += thetaInc;
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            double x = (getWidth() - image.getWidth())/2;
            double y = (getHeight() - image.getHeight())/2;
            AffineTransform at = AffineTransform.getTranslateInstance(x,y);
            at.rotate(theta, image.getWidth()/2, image.getHeight()/2);
            g2.drawRenderedImage(image, at);
        private BufferedImage convert(Image src) {
            int w = src.getWidth(this);
            int h = src.getHeight(this);
            int type = BufferedImage.TYPE_INT_RGB; // options
            BufferedImage dest = new BufferedImage(w,h,type);
            Graphics2D g2 = dest.createGraphics();
            g2.drawImage(src,0,0,this);
            g2.dispose();
            return dest;
        private MouseListener ml = new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
                rotate();
    }

  • Should ADF tables created for Toplink or Web Services behave the same?

    In JDev 11g TP3, When you drag the collection data control onto a JSF, should the read only tables created from either Toplink objects or Web Service Data Controls look and behave the same? I am not able to get tables created with Web Service Data Controls to work the same as those shown in tutorials or examples.
    Thanks,
    Al

    Not so sure, 11G does seem to generate all of the controls for the response elements, even those that have nested complex types such as the one enclosed. Used the 11G TP3 Web Service Data Control wizard and all of the nested controls showed up. BUT, when dropped onto a JSF, they do not work the same as the tutorials and examples. So, I'm either doing something wrong or the controls are not working properly.
    Should I not use the 11G WSDC and just follow your example in complex return types? Or are there other steps or settings in the 11G WSDC that I need to discover (they're not documented) in order to make ADF tables work with the 11G WSDC? If so, can you help?
    <xsd:element name="PanelData" type="ns1:PanelData"/>
    <xsd:complexType name="PanelData">
    <xsd:sequence>
    <xsd:element name="lotinfo" type="ns1:LotInfoData" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="backglass" type="ns1:LotInfoData" minOccurs="1" maxOccurs="unbounded"/>
    <xsd:element name="frontglass" type="ns1:LotInfoData" minOccurs="1" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>

  • How to create table maintence  with function group

    plz send me replay.
    urgent.

    Hi,
    Refer this:
    1.
    Create Maintenance Dialog 
    To generate the maintenance dialog for a table or view:
    Choose Development ® Other tools ® Gen.tab. maint. dialog. You go to the maintenance transaction initial screen.
    Enter the name of the table or view.
    Choose Generated objects.
    Choose Create/Change.
    Confirm the maintenance module creation prompt.
    Enter the generation data:
    – Maintenance module function group
    You can put maintenance modules for several tables or views in a function group.
    – Authorization group
    – Maintenance type (one/two-level)
    – Maintenance screen numbers
    – Recording routine (standard/individual or none)
    Choose Create. All components required are generated.
    When a maintenance dialog is generated, an entry with an object list is created in the maintenance object description table. All tables involved are in this object list.
    http://help.sap.com/saphelp_nw04/helpdata/en/a7/513477407a11d1893b0000e8323c4f/frameset.htm
    2. https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc
    3. Important : u must activate Function group before generating table maintainance.
    Jogdand M B

  • Problem while creating Table control with wizard

    Hi All,
    I am using the table control wizard.
    Following is the declared data :
    TYPES: BEGIN OF test_str,
            name TYPE string,
            city TYPE string,
          END OF test_str.
    DATA: lt_str TYPE STANDARD TABLE OF test_str,
          ls_str TYPE test_str.
    I activated the program after declaring this..
    then I created a screen.
    while generating the table control , i give the internal table name as lt_str and work area as  ls_str(both of these are also coming in F4 help) , i am getting the following error :
    the table work area  ls_str does not exist or is not a structure.
    Please help.
    Regards
    Panneer

    HI Selvam
    In the wizard please choose the radio button internal program table. I hope you might have choosen the dictonary table.
    And activate the program before generating the wizard.
    Please try this and let me know if any issues.
    Thanks
    Praveen
    Edited by: Praveen Kumar on Feb 4, 2010 4:34 AM

  • .click on row works with php table - does not work with javascript table.

    Howdy,
    I've run into a very interesting problem today, and I hope you'll be able to help me.
    I have a page in which the top is php to read a table from the server, and post the table as the html page is being built.
    The data come up as a table, and each row is clickable, that click moving the user to a different page, based on the row clicked.
    Here are the relevant parts of the php code:
    <?php
    echo "<table id='patienttable' cellpadding=5px border=0 font-size=16px>";
    echo "<tr><th width='30'>"."ID#"."</th><th width='100'>"."Last Name"."</th><th width='100'>"."First Name"."</th><th width='100'>".
    "Middle Name"."</th><th width='80'>"."DOB"."</th><th width='50'>"."Zip"."</th><th width='50'>"."Gender"."</th><th width='100'>".
    "Phone"."</th></tr>";
    while ($row = mysqli_fetch_array($result))
    blah blah blah
    echo "<tr><td id='localid'>".$localid. "</td><td>".$lastname. "</td><td>".$firstname. "</td><td>".$middlename."</td><td>".$dob."</td><td>".$physzip. "</td><td>".$gender."</td><td>".$phone1.       "</td></tr>";
      echo "</table>";
    ?>
    And here is the code to click on a row:
    $("#patienttable tr").click(function() {
           var passthis = $(this).find("#localid").html();
           $.post("php/setsessionvariable.php",
                  {sessionval: passthis},
         function(e) {window.location.href = "root.php"}
    EVERYTHING works great - no problems - working now for about 2 months.
    Today I started to build something similar, BUT! I cannot read from the database at the top of the page, I must do an ajax query, call the db, and post the data in a table;
    Here is the boring, fairly straight-forward javascript code:
    $.ajax({
        type: "POST",
        url: "findpatientbackend.php",
        data: {letterslastname: lastname},
        dataType : 'json',
        success: function(result) {
      $("#div1").html("");
            if(result.length >= 1)
       {var output = "";
             $("div1").html("<table id='findtable'>");
              $.each(result, function(index, value) {
                                                     output += "<tr><td width='100px'></td><td id='localid' width='100px'>"
                 + value.localid + "</td><td width='100px'>"
                 + value.lastname + "</td><td width='100px'>"
                 + value.firstname + "</td><td width='100px'>"
                 + value.middlename + "</td><td width='100px'>"
                 + value.dob + "</td></tr>";
                $("#div1").html(output);
             $("div1").html("</table>");  
        error : function() { alert("error on return"); }
    And here is the click row code, almost EXACTLY like the one above:
    $("#findtable tr").click(function() {
           var passthis = $(this).find("#localid").html();
           $.post("php/setsessionvariable.php",
                  {sessionval: passthis},
         function(e) {window.location.href = '../root.php'}
    All the "stuff" loaded onto the page just fine, BUT, absolutely nothing happens when I click a row.
    Playing around this afternoon, I did a "View Source" on both pages, and saw something VERY interesting;
    1 - The table written by PHP is present, can be seen, and therefore is "clickable" to the jquery .click function.
    2 - The table written by javascript is INVISIBLE! I cannot see it in the source view (but I can see it on the screen) and therefore the .click function can't see it either.
    Questions:
    1. How can I make the table written in javascript "clickable" - how can I make the javascript table "visible"?
    2. Could it be the use of ".html" to post the table to the div? Is there another way?
    And again, I thank you in advance for any help.

    I found the solution to my problem, and perhaps my comments here will help others.
    Thinking a bit more, I wrote a separate javascript routine that created a table, allowed it to be styled, and allowed it to be clickable.
    Here is the code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js" type="text/javascript"></script>
    <style>
    #findtable {
    width:200px;
    background-color:#CFD3FE;
    margin:10px auto;
    text-align:center;}
    </style>
    <body>
    <div id="puttablehere"></div>
    <script>
    $(document).ready(function () {
    var output = "<table id='findtable'>";
    for (var i = 0; i<15; i++) {output += "<tr><td width='100px'>X</td><td id='localid' width='100px'>X</td></tr>";}
    output += "</table>";
    $("#puttablehere").html(output);
    $("#findtable tr").click(function(e) { alert("it works!"); });
    </script>
    </body>
    </html>
    The initial code I posted was creating the table the wrong way.
    You have to create the WHOLE table at the same time, and post it all at once.
    The code above does that.
    My learning points are:
    1. To create a table in javascript, and post it with a $("#puttablehere").html(output); call, you must put the ENTIRE table into that single string variable called "output" (or whatever you want to call it).
    2. Everytime you call a jqeury .html function like this: ---("#puttablehere").html(output); -- It COMPLETELY over-writes the whole div/tr/td block that it is pointed at.
    3. If you create a table in javascript (client side) you cannot see it with "View Source" - because what is posted in the table is AFTER the DOM is loaded.
    Creating a table with php server side - you CAN see, because it is posted with the DOM.
    So I thank you for your ideas, and I hope this may help another noob, such as myself, in the future.
    Adios!

  • Create price range search function in php recordset

    Hi,
    On a continuation from a previous thread, I am finding that the expertise of the web designers on these forums is proving much more educational and beneficial than the vast numbers of books I have bought to setup a website for my property company. (Without sounding too sycophantic!).
    I have managed to create a working website where the properties in my database and their related images are pulled into a recordset on the live webpage and everything is working perfectly. I do however want to add some simple filters on the search page to narrow down the results from the database.
    I am finding that given one push or piece of coding I can work out the rest myself. Therefore, all I would like to do is create a price range drop down, where clients can select properties from the database in one of 3 categories: under £1m, £1m-£2m, and over £2m.
    As I understand it, I need two pages to do this, one html form page where the clients will input their search criteria with coding similar to:
    <form action="search_results.php" method="post" name="search" id="search" >
    Price Range:
    <select name="prop_price" id="select8">
    <option value="<1000000">             >£1,000,000                   </option>
    <option value="1000000-2000000">    £1,000,000 - £2,000,000</option>
    <option value=">2000000">             >£2,000,000                   </option>
    </select>
    <input name="search" type="submit" id="search" value="search">
    </form>
    (apologies for my messy coding - I am still new and not sure if certain fields arent required yet!).
    Then, I would need to create the search_results.php page which would give the results of properties in the database depending on the price range submitted. I have tried various different methods put online through the forums, but cannot seem to get anything post 2006, nor anything that has actually worked. I am using Dreamweaver CS5 and MySQL for my db.
    How do I incorporate the above search criteria into a dynamic php doc? The only way I have managed to get something working is to create a new page for each of the price variables -something which is incredibly inefficient, and hardly something that can be developed easily going forward.
    The php code I currently have that is retrieving all the properties from my database is as follows (connection name is test, recordset name is getDetails):
    <?php require_once('Connections/test.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $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;
    $maxRows_getDetails = 20; 
    $pageNum_getDetails = 0; 
    if (isset($_GET['pageNum_getDetails'])) { 
       $pageNum_getDetails = $_GET['pageNum_getDetails']; 
    $startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;
    mysql_select_db($database_test, $test);
    $query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, image FROM images order by prop_price DESC";
    $query_limit_getDetails = sprintf("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails); 
    $getDetails = mysql_query($query_limit_getDetails, $test) or die(mysql_error());
    $row_getDetails = mysql_fetch_assoc($getDetails);
    if (isset($_GET['totalRows_getDetails'])) { 
       $totalRows_getDetails = $_GET['totalRows_getDetails']; 
    } else { 
       $all_getDetails = mysql_query($query_getDetails); 
       $totalRows_getDetails = mysql_num_rows($all_getDetails); 
    $totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;
    ?>
    <table width="990" border="0" align="center" cellpadding="0" cellspacing="0"> 
         <tr>   
         </tr> 
         <?php do { ?> 
           <tr>   
             <td><img src="show_image.php?id=<?php echo $row_getDetails['id']; ?>"></td> 
             <td><?php echo $row_getDetails['prop_name']; ?></td>
             <td><?php echo $row_getDetails['prop_price']; ?></td>
             <td><?php echo $row_getDetails['short_desc']; ?></td>
             </tr> 
             <?php } while ($row_getDetails = mysql_fetch_assoc($getDetails)); ?> 
             </table> 
    <?php
    mysql_free_result($getDetails);
    ?>
    Essentially, I need to incorporate the WHERE function into my sql query, but how do I do this so that it is dependent on the clients submission on the search page.......?
    Sorry if this is incredibly easy, but I am at a complete loss now and cant try any more techniques from the various forums out there! I even downloaded the entire Zen cart framework just to see if I could find something in the vast numbers of php pages that came with it!
    Hope someone can help -
    Thanks
    Jack

    Hi Gunter,
    Thanks for your quick response. I thought I had it but not quite yet. I uploaded these pages into live browser but am only getting the following on the search results page:
    This is the case for all three parameters. As I have not yet uploaded all the properties into mysql, there are only 2 live ones in there, one is prop_price at 600,000 (int) and the other prop_price 2300000 (int). For the query to work, should this field in mysql be a different format?
    For your reference, the new show_results.php code is:
    <?php require_once('Connections/test.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $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;
    $maxRows_getDetails = 20;
    $pageNum_getDetails = 0;
    if (isset($_GET['pageNum_getDetails'])) {
       $pageNum_getDetails = $_GET['pageNum_getDetails'];
    $startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;
    if(isset($_POST['prop_price']))
    switch($_POST['prop_price'])
      case ("a"):
    $price_whereclause = ' WHERE prop_price < 1000000 ';
      break;
      case ("b"):
    $price_whereclause  = ' WHERE prop_price BETWEEN 100000 AND 200000 ';
      break;
      case ("c"):
    $price_whereclause  = ' WHERE prop_price < 2000000 ';
      break;
    else {
    $price_whereclause  = '';
    mysql_select_db($database_test, $test);
    $query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, image FROM images ".$price_whereclause." order by prop_price DESC";
    $query_limit_getDetails = sprintf("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails);
    $getDetails = mysql_query($query_limit_getDetails, $test) or die(mysql_error());
    $row_getDetails = mysql_fetch_assoc($getDetails);
    if (isset($_GET['totalRows_getDetails'])) {
       $totalRows_getDetails = $_GET['totalRows_getDetails'];
    } else {
       $all_getDetails = mysql_query($query_getDetails);
       $totalRows_getDetails = mysql_num_rows($all_getDetails);
    $totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;
    ?>
    <table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>  
         </tr>
         <?php do { ?>
           <tr>  
             <td><img src="show_image.php?id=<?php echo $row_getDetails['id']; ?>"></td>
             <td><?php echo $row_getDetails['prop_name']; ?></td>
             <td><?php echo $row_getDetails['prop_price']; ?></td>
             <td><?php echo $row_getDetails['short_desc']; ?></td>
             </tr>
             <?php } while ($row_getDetails = mysql_fetch_assoc($getDetails)); ?>
             </table>
    <?php
    mysql_free_result($getDetails);
    ?>
    I know its very cheeky, but assuming you can help with fixing this, where in the coding would I insert a "No properties returned. Please try another query" response should the db not have anything in the set parameters (instead of the symbol currently being displayed).
    Again thanks so much for all your help.
    Jack

Maybe you are looking for

  • ITunes wont connect to the internet, connection refused. Need help

    I have no idea what settings were moved on my laptop, but now everytime i open itunes and i try to connect to the itunes store, it shows the message: "ITUNES COULD NOT CONNECT TO THE ITUNES STORE. THE NETWORK CONNECTION WAS REFUSED. Make sure your ne

  • Key combination Ctrl-Home Ctrl-End not working.

    vim has a default binding for <Ctrl-Home> goes to the beginning of the file and <Ctrl-End> for the end. However, I couldn't get these key combinations to work for me. And I've consulted the #vim channel on freenode. They said it maybe a problem that

  • My iPhone4S is in recovery mode. HELP!

    My phone is in recovery mode and it is not fully backed up! HELP!

  • Error while chaging backup location.

    By default rman use flash_recovery_area folder to save backup set. I give following command to save backup on different location. Now i want default location, for which i give second command, advise by srp on forum, i am getting error, although comma

  • SQL 2000 export to discoverer

    Does anybody know how to export data from SQL 2000 to an EEX file? I want to create an EUL for discoverer. I already created an oracle database and want to import the EEX file to discoverer. Is there a tool for this export?