Search
Left Quote    Wise men speak because they have something to say; Fools because they have to say something.
- Plato (427-347 B.C.)    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: I Dunno if this is possible is it?
  This user is offline  access
  Subject: "I Dunno if this is possible is it?" Posted: @ 4:44 pm on Jun 20 2007   

Member #: 275
Rank: User - (6)
Since: 02/12/07
Posts: 6
From: Kamloops, BC

I am trying to created a function that will insert text into a Database however, I want to define the table and for it to dinamically get the fields in that table and store it in an array little EX:
Code:
function insert($path,$f ileN,$text,$com m,$img,$temp,$t able){
} elseif (!empty($table) ) {
$sel_res = "Select * from '$table'"< br /> sqlquery($sel_r es);
############### ############### ############### ############### ###
  1. Need to firgure out how to place Field names in to an array #
##### ############### ############### ############### ############# $usr_contini = "insert into '$table'('$feil d[0]','$field[1 ]','field[2]') values ('$fileN','$tex t'....)";< br /> sqlquery($user_ contini);



hope someone can help een searching for a while but allsyntax seems to be the only plce that answers questions :)


    Viewed: 5,075 Times | Reply to This | To top
  This user is offline  misterhaan
  Subject: "re: I Dunno if this is possible is ..." Posted: @ 2:14 pm on Jun 21 2007    

Member #: 5
Rank: User - (213)
Since: 02/11/05
Posts: 148
From: chair

you can get the field names using a describe query: "describe `$table`" will give you each column in the table as a result. each result Field, Type, Null (yes/no), Key, Default, and Extra -- you would just need to look at everything in Field though to get your field names.




please note that the above post is likely made up in its entirety.

    Viewed: 5,059 Times | Reply to This | To top
  This user is offline  sm0ke
  Subject: "re: I Dunno if this is possible is ..." Posted: @ 1:02 am on Jun 22 2007    

Member #: 168
Rank: User - (83)
Since: 06/05/06
Posts: 34
From: Manchester - UK

  misterhaan said...

< i> you can get the field names using a describe query: "describe `$table`" will give you each column in the table as a result. each result Field, Type, Null (yes/no), Key, Default, and Extra -- you would just need to look at everything in Field though to get your field names.

Have to agree.




Just because I dont care, doesnt mean I dont understand.

purepcs@hotmail
.co.uk |     Viewed: 5,052 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank