User Profile

Collapse

Profile Sidebar

Collapse
stewc
stewc
Last Activity: Feb 14 '08, 03:26 PM
Joined: Oct 1 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • stewc
    started a topic Multiple line strings

    Multiple line strings

    Hi

    I am using this line of code

    Code:
    var str = (<r><![CDATA[{JR_ADDRESS}]]></r>).toString();
    to convert a multiple line string to a single line so I can remove the line breaks

    It works great in Firefox but doesn't in IE. I can't understand why!!!

    Any ideas?? Is there a IE friendly way of doing this?

    Many thanks?
    See more | Go to post

  • stewc
    replied to How to use a part of a string using MySQL.
    Hi ,

    That makes a lot more sense - even formatting it like that

    So which selects go with which froms? Eg if it was broken down

    [code=mysql]
    SELECT COUNT(dest.outc ode) as density FROM hwz_users AS source

    SELECT dest.outcode, dest.x, dest.y FROM hwz_postcodes AS dest

    WHERE source.outcode = dest.outcode

    GROUP BY dest.outcode ASC
    [/code]...
    See more | Go to post

    Leave a comment:


  • stewc
    replied to How to use a part of a string using MySQL.
    Can someone explain what this line of code does?

    I sort of understand it but am confused by the dest.outcode (what is the purpose of the dot) and the variables seperated by the commas?

    [code=php]
    $query_userCoor ds = "SELECT COUNT(dest.outc ode) as density, dest.outcode,
    dest.x, dest.y FROM hwz_users AS source, hwz_postcodes AS dest WHERE
    source.outcode = dest.outcode GROUP BY dest.outcode A...
    See more | Go to post

    Leave a comment:


  • stewc
    replied to How to use a part of a string using MySQL.
    I tried this
    [code=php]
    query= "SELECT COUNT(dest.outc ode) as density, dest.outcode, dest.x, dest.y FROM content AS source, postcodes AS dest WHERE substr(strrchr( $row['address'],">"),1,4) = dest.outcode GROUP BY dest.outcode ASC";
    [/code]

    but it throws up an error. This must not be the way to do it
    See more | Go to post
    Last edited by Atli; Oct 3 '07, 02:17 PM. Reason: Added [code] tags.

    Leave a comment:


  • stewc
    started a topic How to use a part of a string using MySQL.

    How to use a part of a string using MySQL.

    I have a database in which there is a table 'content' which contains a field called 'address'

    This line of code pulls some info from the database
    [code=php]
    $query= "SELECT COUNT(dest.outc ode) as density, dest.outcode, dest.x, dest.y FROM content AS source, postcodes AS dest WHERE address = dest.outcode GROUP BY dest.outcode ASC";
    [/code]
    'address' is in the form

    '1 Street Name<br/...
    See more | Go to post
    Last edited by Atli; Oct 3 '07, 02:15 PM. Reason: Added [code] tags.

  • stewc
    replied to Retrieving Data from a table
    Thanks!! Very much . I will give it a go
    See more | Go to post

    Leave a comment:


  • stewc
    replied to Retrieving Data from a table
    No its just one value....
    See more | Go to post

    Leave a comment:


  • stewc
    started a topic Retrieving Data from a table

    Retrieving Data from a table

    Hi

    I have a database called CARS within it is a table called FORD which contains a field called SPEED.

    All I want to do is write some simple php code to retrieve the first entry in the field SPEED and print it to the screen.

    Can anyone help? I am just starting so any help would be great

    TIA
    See more | Go to post
No activity results to display
Show More
Working...