add query to a function

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
glennn.php
Forum Commoner
Posts: 41
Joined: Sat Jul 08, 2006 12:26 pm

add query to a function

Post by glennn.php »

i'm trying to add a "create table if not exists $picId" query to this function,


Code: Select all

function edituser $picId,$firstname,$lastname,$password,$aka,$email,$url,$website,$city,$state,$talent,$biography,$approved,$customerid) {
      $sql = "update stars set picId='$picId',password='$password',email='$email',firstname='$firstname',lastname='$lastname',aka='$aka',website='$website',url='$url',city='$city',state='$state',talent='$talent',biography='$biography',approved='$approved' where customerid='$customerid'"; 
$results = $this->update($sql);
      return $results;
	    }
and haven't had any luck - also need to remove the .jpg ext that would be on the end of "$picId" in the query.

can anyone please show me how this might be done?

thanks in advance
g
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

What 'lack of luck' are you experiencing?
glennn.php
Forum Commoner
Posts: 41
Joined: Sat Jul 08, 2006 12:26 pm

Post by glennn.php »

well, i couldn't get it to create needed Table, but i finally succeeded. thanks...
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If it's not too much to ask, could you A) Post your solution so others can benefit from you experience, and B) Rewrite your original post title to include '[SOLVED] - ' at the beginning? Thanks.
Post Reply