Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    4

    Unanswered: Assign a variable to multiple queries

    Ey im just a newbie to php/mysql... i just like to ask a question regarding the sample queries below if i can assign/store a single variable to all of it and how to do it.


    Insert Into Mytable1(fname,lname) values('nick','smith')
    Insert Into Mytable2(ProdID,ProdName) values('01','PC')
    Insert Into Mytable3(ORno,Date) values('01','01/01/01')

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    please elaborate -- what does "assign/store a variable" mean?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2006
    Posts
    4
    Oh... Im sorry for that... What I really mean is that id like to assign a single php variable and store the 3 queries on it if it is possible...

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    well, i think i know what you mean

    make a string and just concatenate the three query statements but be sure to separate them with semi-colons

    if you're going through ODBC there might be a problem but mysql itself has no difficulty running multiple statements (e.g. a mysqldump script)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Sep 2006
    Posts
    4
    ok... i already get it... tnx so much... =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •