User Profile

Collapse

Profile Sidebar

Collapse
omar999
omar999
Last Activity: Sep 9 '13, 03:04 PM
Joined: Mar 15 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • omar999
    started a topic php multiple file upload using array or for loop
    in PHP

    php multiple file upload using array or for loop

    I have a working example below of a single file input upload via php and now I'd like to upload multiple files either by iterating through each input type="file".

    I've read that the multiple attribute on the input tag is not supported below IE10 so I think the best way would be to have several input type=files in order to loop through them

    any help is appreciated

    Code:
    	<input type="file"
    ...
    See more | Go to post

  • omar999
    started a topic get id of button once clicked using php
    in PHP

    get id of button once clicked using php

    i have a form with several inputs and corresponding buttons. The input name attribute and button id are both the same. i.e

    Code:
    	<form method="post" action="update.html">
    		<input type="text" name="title">
    		<button id="title">Submit</button>
    
    		<input type="text" name="metaKeywords">
    		<button
    ...
    See more | Go to post

  • omar999
    replied to asp loop question
    will this code be of any use?

    Code:
    IF (objRSYVRROUNDTRIPS.Fields.Item("outbound_route").Value) & "London Gatwick to" THEN
    	Response.Write "test"
    End If
    ??
    See more | Go to post

    Leave a comment:


  • omar999
    started a topic asp loop question

    asp loop question

    hi guys

    i think i may have a syntax error but im not sure. im basically getting stuck where my if statement checks to see if column 'outbound_route ' contains 'London Gatwick to Vancouver' then print some html but no html is printing and im not getting any errors either.

    Code:
    IF objRSYVRROUNDTRIPS("outbound_route") = "London Gatwick to Vancouver" THEN
    	Response.Write "<li><a href=""#LGWYVR"">London
    ...
    See more | Go to post

  • omar999
    started a topic multiple jquery script conflict?

    multiple jquery script conflict?

    hi guys

    i really dont understand where i am going wrong.I've read countless articles including http://blog.nemikor.co m/2009/10/03/using-multiple-versions-of-jquery/ but still having trouble with multiple versions of jquery not working. either the jquery slideshow doesnt work or the jquery ie select width fix doesnt work! rrghhh

    Code:
    <head>
    <link href="/css/styles.css" rel="stylesheet"
    ...
    See more | Go to post

  • omar999
    replied to how to join 2 sql queries
    david thank you very much! you have solved my problem with your super sql skills - much appreciated.

    omar.
    See more | Go to post

    Leave a comment:


  • omar999
    replied to how to join 2 sql queries
    david

    thank you for your reply. it seems you have hit the nail on its head. your suggestion seems perfect to what I'm trying to achieve. although it just needs a small tweak..

    working query
    Code:
    use prices
    SELECT ID, ISNULL(Price_Band_1, 0) AS Price1, ISNULL(price_band_2, 0) AS Price2, ISNULL(price_band_3, 0) AS Price3, 
    ISNULL(price_band_4, 0) AS Price4, ISNULL(price_band_5, 0) AS Price5, derivedtbl_1.totalsum
    ...
    See more | Go to post

    Leave a comment:


  • omar999
    replied to how to join 2 sql queries
    hi CK - i basically want to ascertain both query results.. dont need a total of both queries comnbined but just the results of both queries if that makes sense..

    i know you can use the UNION all to join 2 sql queries but I couldnt quite work out how ...

    thanks in advance
    Omar.
    See more | Go to post

    Leave a comment:


  • omar999
    replied to how to join 2 sql queries
    hi david - thanks for your reply


    I've tried your suggestion but I'm getting the following error?
    Msg 156, Level 15, State 1, Line 2
    Incorrect syntax near the keyword 'CROSS'.
    Msg 102, Level 15, State 1, Line 3
    Incorrect syntax near ')'.

    please advise

    Omar.
    See more | Go to post

    Leave a comment:


  • omar999
    started a topic how to join 2 sql queries

    how to join 2 sql queries

    hi guys

    im a little stuck - how would I join this query
    Code:
    select *,isnull(price_band_1,0)+isnull(price_band_2,0)+isnull(price_band_3,0)+isnull(price_band_4,0)+isnull(price_band_5,0) as pricesum 
    from TESTCA_Specials WHERE ID IN (1, 3, 5, 9, 13, 19, 31)
    to
    Code:
    select totalsum = SUM(totalsum) from
    (Select isnull(price_band_1,0)+isnull(price_band_2,0)+isnull(price_band_3,0)+isnull(price_band_4,0)+isnull(price_band_5,0)
    ...
    See more | Go to post

  • problem solved
    See more | Go to post

    Leave a comment:


  • hi jared

    thats right im putting the isnull() on the individual column names.

    sorry for the confusion but I was just getting myself confused as I wanted to do a check if there are any prices within for example 3 records on all 5 columns. I've achieved this by doing
    Code:
    select pricesum = SUM(pricesum) from
    (Select isnull(price_band_1,0)+isnull(price_band_2,0)+isnull(price_band_3,0)+isnull(price_band_4,0)+isnull(price_band_5,0)
    ...
    See more | Go to post

    Leave a comment:


  • omar999
    replied to asp if statement problem
    im not sure where im going wrong but I've tried your suggestion but im receiving an error
    Code:
    Do while not objRS.Eof
     
    for each x in objRS
       Response.write x.name & ": "& x.value & " (" & x.type & ")<br />" 
    Next
     
    'move to the next record in the recordset
    objRS.movenext
     
    Loop
    error
    Microsoft VBScript runtime error...
    See more | Go to post

    Leave a comment:


  • hi jared

    the price field columns are of type integer.
    does Select isnull(column, 0) replace null with 0 similar to the sql replace function?

    we are so close! your suggestion Select isnull(column, 0) works fine if all 5 price_field columns on a record include at least 1 integer - then the 'pricesum' column adds up all 5 columns and ignores any null columns.

    problem is now that if all 5 price_field columns...
    See more | Go to post

    Leave a comment:


  • update: I've figured out the problem here. the price_band_5 column is NULL and contains no values.

    I've verified this as I tried
    Code:
    select price_band_1,price_band_2,price_band_3,price_band_4,price_band_1+price_band_2+price_band_3+price_band_4 as pricesum from TESTCA_Specials
    works fine as it seems to be mathematically adding the values on these 4 columns.

    is there any way to get around if a column is null...
    See more | Go to post

    Leave a comment:


  • hi jared

    ok i understand - i used the query in sql and saw an independant 'pricesum' column but the entire column is NULL which doesnt make sense. I get the same result once I print on front end web page...

    so does this mean its neither mathematically adding or concatenating the values?

    I also tried objRS("pricesum ") > 0 as per your suggestion but I get the same I have no value output...
    ...
    See more | Go to post

    Leave a comment:


  • omar999
    replied to asp if statement problem
    hi again jared : )

    ok I've looped

    Code:
    SQL = "SELECT * FROM UK_Specials WHERE ID IN (7,11,15)"
    
    DIM objRS
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open SQL, objConn
    
    Do while not objRS.Eof
    
    For x=1 To 5
    Response.Write objRS("ID") & " " & objRS("Flight_Route") & " &pound; " & objRS("Price_Band_"
    ...
    See more | Go to post

    Leave a comment:


  • what exactly does the col1+col2+ do within the sql query? does it merge both columns or does it mean col1 plus col2? so for example if col1 had 10 within it and col2 had 10 then it retains 20 as objRS("pricesum ")?? am i right?

    have tried your suggestion as
    Code:
    SQL = "select *, price_band_1+price_band_2+price_band_3+price_band_4+price_band_5 as pricesum from UK_Specials"
    
    if objRS("pricesum")<0
    ...
    See more | Go to post

    Leave a comment:


  • help with sql where in statement within asp if statement

    im using classic asp and sql server. my if statement checks if there is a price within 5 places [price_band_1 to 5] and then if any has a value shoud output 'I HAVE DATA' but it doesnt.. can anyone help?

    i dont get any errors but Instead 'I HAVE NO DATA' is output on the page. this is clearly wrong if you look at my sample data from sql server

    Code:
    <%
    'CHECK FOR PRICES
    DIM objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    ...
    See more | Go to post

  • omar999
    replied to asp if statement problem
    Code:
    if obj("Id") = "11" then
    didnt work either... any other ideas?
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...