Re: [PHP] setting function variables

2003-08-08 Thread Micah Montoya
Ooops.  Can't believe I overlooked that.  Thanks everyone for your input.
Its up and running now.


- Original Message - 
From: Mark [EMAIL PROTECTED]
To: Micah Montoy [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 2:36 PM
Subject: Re: [PHP] setting function variables



 --- Micah Montoy [EMAIL PROTECTED] wrote:
  Tried this and it returns errors of type:
 
  Warning: Wrong parameter count for mssql_result() in
  c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php
  on line 78
 
  Warning: mssql_result(): supplied argument is not a valid MS
  SQL-result
  resource in
  c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php
  on line 79
 
  Warning: Wrong parameter count for mssql_result() in
  c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php
  on line 78
 
  Warning: mssql_result(): supplied argument is not a valid MS
  SQL-result
  resource in
  c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php
  on line 79
 
  Lines 78 and 79 read like this:
 
  $img_numbers = $qryResults(SELECT COUNT(img_id) AS TotalImages

 This should be $runQuery(), not $qryResults()

  FROM images
  WHERE category_id = '$row[0]');
  $img_count = $qryResults($img_numbers,0,TotalImages)
 
  The variables are specified as
 
  $runQuery = 'mssql_query';
  $qryResults = 'mssql_result';
 
  Any ideas of why it would be doing this?  Everything works fine
  when I don't
  try to use the variables.
 
  thanks
 
  Cpt John W. Holmes [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   From: Mark [EMAIL PROTECTED]
--- Micah Montoy [EMAIL PROTECTED] wrote:
 I am trying to specify a single php file to contain all the
 variables and I
 just call this file where necessary.  What I am running into
  is
 that I want
 to do this for all the built in functions (i.e. mssql_query)
  as
 well.  I've
 tried numerous attempts but can't get it to operate without
  wanting
 to run
 the functions or return an error.  Something like this:

 $runQuery = @mssql_query;
 $qryResults = @mssql_result;
 $getRow = @mssql_fetch_row;
 $getRowNums = @mssql_num_rows;
   
Use a database abstraction class (ADODB, Pear, or something
  from
phpclasses.org). You're trying to assign a variable to a
  function's
actions, when you can only assign the variable to teh ooutput
  of the
function.
  
   A good suggestion, since this is what your creating, basically.
  
   Anyhow, if you really want to do it your way, it'd be like this:
  
   $runQuery = 'mssql_query';
   $getRow = 'mssql_fetch_row';
  
   Then you'd use them like this:
  
   $result = $runQuery(select ... );
   while($row = $getRow($result))
   {
 ...
   }
  
   ---John Holmes...
  
 
 
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 =
 Mark Weinstock
 [EMAIL PROTECTED]
 ***
 You can't demand something as a right unless you are willing to fight to
death to defend everyone else's right to the same thing.
 ***

 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] preg_replace - understanding

2003-07-08 Thread Micah Montoya
You where right.  That's what it was doing but now its not reversing the
direction.  It at least is a single \.  Have an idea for reversing it.  I
played with it a bit but still no go on this.

thanks


- Original Message - 
From: Jennifer Goodie [EMAIL PROTECTED]
To: Micah Montoy [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 5:43 PM
Subject: RE: [PHP] preg_replace - understanding


  $filevalue = str_replace(\\, /, $filevalue);
 
  it is reversing the \\ to // but not replacing them with just a
single
  /.

 I think you need to escape your \ so each \ is \\ so your string should be
 






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] preg_replace - understanding

2003-07-08 Thread Micah Montoya
Never mind.  Its working.

thanks

- Original Message - 
From: Jennifer Goodie [EMAIL PROTECTED]
To: Micah Montoy [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 5:43 PM
Subject: RE: [PHP] preg_replace - understanding


  $filevalue = str_replace(\\, /, $filevalue);
 
  it is reversing the \\ to // but not replacing them with just a
single
  /.

 I think you need to escape your \ so each \ is \\ so your string should be
 






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] looping through values from a field? Need hellp.

2003-07-05 Thread Micah Montoya
I think that will do it.

thanks,

- Original Message - 
From: Lars Torben Wilson [EMAIL PROTECTED]
To: Micah Montoy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 4:59 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.


 On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
  I have this javascript that enables browsing and selecting of a file.
This
  file location and name are then transferred further down in the form as
an
  option.  Multiple files may be chosen as they are just added one below
the
  other.  Anyway, when the form is submitted it is only retrieving the
last
  file name from the form.  How can I get PHP to return all the values
from
  the select part.  Basically this is what is happening:
 
  1.  Choose a file  input type=file name=viewing
onchange=loadImg();
  2. File location and name are displayed in the
  select name=imgList style=width:350; size=6 multiple/select as
  option value=c:\images\filename.gifc:\images\filename.gif/option
  The javascript creates the option and a new option is added and appended
  when a new file is chosen.
  3. Submit form to php script to send location and stuff to database.
 
  Anyone have any ideas of how I can get PHP to loop through and pull out
each
  option value?  They are separated by a comma.  Right now, it only grabs
the
  last file even though all files are highlighted before submission.
 
  thanks


 http://ca2.php.net/manual/en/faq.html.php#faq.html.select-multiple


 Hope this helps,

 Torben

 -- 
  Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
  http://www.hybrid17.com  http://www.themainonmain.com
  - Boycott Starbucks!  http://www.haidabuckscafe.com -







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] looping through values from a field? Need hellp.

2003-07-05 Thread Micah Montoya
Ok.  I gave it a shot but have run into one other question that I wasn't
able to find that was addressed by the article.

My select statement looks like this:

select name=imgList[] style=width:350; size=6 multiple/select

When I create the php file, I am trying something like below but it isn't
working and I am receiving an error.  What am I not doing?

$filename = $_POST[imgList];

for each ($filename as $value) {
 echo $value;
}

thanks



- Original Message - 
From: Lars Torben Wilson [EMAIL PROTECTED]
To: Micah Montoy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 4:59 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.


 On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
  I have this javascript that enables browsing and selecting of a file.
This
  file location and name are then transferred further down in the form as
an
  option.  Multiple files may be chosen as they are just added one below
the
  other.  Anyway, when the form is submitted it is only retrieving the
last
  file name from the form.  How can I get PHP to return all the values
from
  the select part.  Basically this is what is happening:
 
  1.  Choose a file  input type=file name=viewing
onchange=loadImg();
  2. File location and name are displayed in the
  select name=imgList style=width:350; size=6 multiple/select as
  option value=c:\images\filename.gifc:\images\filename.gif/option
  The javascript creates the option and a new option is added and appended
  when a new file is chosen.
  3. Submit form to php script to send location and stuff to database.
 
  Anyone have any ideas of how I can get PHP to loop through and pull out
each
  option value?  They are separated by a comma.  Right now, it only grabs
the
  last file even though all files are highlighted before submission.
 
  thanks


 http://ca2.php.net/manual/en/faq.html.php#faq.html.select-multiple


 Hope this helps,

 Torben

 -- 
  Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
  http://www.hybrid17.com  http://www.themainonmain.com
  - Boycott Starbucks!  http://www.haidabuckscafe.com -







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] looping through values from a field? Need hellp.

2003-07-05 Thread Micah Montoya
That was the trick.  Just the space was messing things up.  Thanks.


- Original Message - 
From: Lars Torben Wilson [EMAIL PROTECTED]
To: Micah Montoya [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 6:18 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.


 On Sat, 2003-07-05 at 17:13, Micah Montoya wrote:
  Ok.  I gave it a shot but have run into one other question that I wasn't
  able to find that was addressed by the article.
 
  My select statement looks like this:
 
  select name=imgList[] style=width:350; size=6 multiple/select
 
  When I create the php file, I am trying something like below but it
isn't
  working and I am receiving an error.  What am I not doing?
 
  $filename = $_POST[imgList];
 
  for each ($filename as $value) {
   echo $value;
  }
 
  thanks

 Impossible to say without know what the error says. :) Anyway, if that
 code is cut-and-pasted, then 'foreach' should have no space in it. That
 would cause a parse error. Otherwise, you could be getting a Notice
 if you're actually passing something in via method=GET but checking
 the $_POST array instead.



 -- 
  Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
  http://www.hybrid17.com  http://www.themainonmain.com
  - Boycott Starbucks!  http://www.haidabuckscafe.com -







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php