Re: [PHP-DB] Where's the error?

2004-04-08 Thread Dan Brunner
Not even the title?!?!

Dan

On Apr 8, 2004, at 2:55 PM, [EMAIL PROTECTED] wrote:

It is not displaying anything at all.

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Friday, April 09, 2004 3:52 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Where's the error?
does the page actually error or does it not do anything?

-Original Message-
From: Robert Sossomon [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 08, 2004 3:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Where's the error?
I have this script which SHOULD produce a linked webpage for soon-to-be
created static web pages, however I can't seem to find the error in my
code:

$display_block = "PFS Sales Categories Select a category to
see its items.";
//Show categories first
$get_cats = "select id_num, id_name, description, cat_code from
PFS_categories order by id_name"; $get_cats_res = 
mysql_query($get_cats)
or die(mysql_error());

if (mysql_num_rows($get_cats_res) < 1)
{
 $display_block = "Sorry, no categories to browse."; }
else {  while ($cats = mysql_fetch_array($get_cats_res))  {
  $cat_id = $cats[id_num];
  if ($cat_id != "53" || $cat_id != "54" || $cat_id != "55" || $cat_id
!= "117" || $cat_id != "118")
  {
  $cat_title = strtoupper(stripslashes($cats[id_name]));
  $cat_desc = stripslashes($cats[description]);
  $display_block .= "$cat_title
$cat_desc\n";
  if ($_GET[cat_id] == $cat_id) //get items
  {
   $get_items = "select id, item_num, description from PFS_items where
cat_code = $cat_id";
   $get_items_res = mysql_query($get_items) or die(mysql_error());
   if (mysql_num_rows($get_items_res) < 1)
   {
$display_block = "Sorry, no Items to browse.\n";
   }
  else
  {
#   $display_block .= "\n";
   while ($items = mysql_fetch_array($get_items_res))
   {
$item_id = $items[id];
$item_num = $items[item_num];
$item_desc = stripslashes($items[description]);
if ($item_num != "ABC-R37" || $item_num !=  "ABC-R42" || $item_num
!= "HB-99100" || $item_num != "RO-PUMPS" || $item_num != "ML-HDGALJUG"
|| $item_num != "PFS-CAC21" || $item_num != "PFS-CO2")
{
$display_block .= "$item_num -
$item_desc\n";
}
   }
#   $display_block .= "\n";
#   $display_block .= "\n";
  }}
 }
}
?>


Categories of Items



  


  


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


RE: [PHP-DB] Re: send email

2003-11-26 Thread Dan Brunner
Hello!!

Sorry I missed you first post.

But you want an auto-email sent out after someone inserts data into the
database, Right??

And of course you want this to be transparent as much as you can.


So do your insert statements to the database then using an IF-ELSE statement
to check if the insert was successful, then in the IF statement-send your
email. 

Like this...

Blah blah blah

$result = mysql_query ($query, $db) or
Die (Mysql_error());
$row_insert = Mysql_affected_rows();

If ($row_insert == 0){
Echo "Sorry you Insert statement was unsuccessful...Please try
again";
}else{
$CC = \"[EMAIL PROTECTED]";

$text .= "This Automatic Email is to inform you that you insert
worked!!.\n";
$text .= "\n";
$text .= "Thank you... ";

$subject = "Auto-email"; 

$header = "From: $CC\nReply-To: $CC\n";
$header .= "Cc: $CC\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/plain\n";
$header .= "Content-Transfer-Encoding: 8bnoit\n\n";
$header .= "$text\n";


mail($To, $subject, "", $header);

}


That should do it!!

And of course you should send some kind of feedback to the user, so they now
it worked as well.


I hope this helps. I know there are better ways of doing this, functions or
classes. But this is quick. 


Good luck!


Dan Brunner






-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 26, 2003 12:50 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: send email

Thanks to all for the input.  I will attempt to make this work.  I am
not a programmer but like to hack around when I can.  If I get lost I
will probably shoot another email out.
thanks,
DF


On Tue, 2003-11-25 at 16:24, Jack van Zanen wrote:
> Hi
> 
> 
> my example earlier does not show the email address in  the source of the
> displayed web page.
> It is in the source code, but you can change that to be put in a config
file
> and include this file in the script.
> 
> 
> Jack
> 
> -Original Message-
> From: howard gramer [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 25 november 2003 21:09
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Re: send email
> 
> 
> I am in the same boat,
> ( I posted a couple of days ago Subject: Re: [PHP-DB] Send formmail data
to
> Email and Database ), not knowing where to put the Mail() into my own
code.
> I am working on it but no success yet.
> 
> But, my real question in this topic; with formmail.pl using Sendmail your
> able to use "recipients_alias = [EMAIL PROTECTED]" inside of the
> FormMail.conf file.  So this means you can hide the email address in the
> configuration file without it being seen in the page source.
> 
> How do you accomplish the same with Mail()? i.e. hiding the email
> 
> 
> howard grC$mer
>   New York City
>[EMAIL PROTECTED]
> 
> 
> >From: "Kim Steinhaug" <[EMAIL PROTECTED]>
> >Reply-To: "Kim Steinhaug" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: [PHP-DB] Re: send email
> >Date: Tue, 25 Nov 2003 19:57:44 +0100
> >
> >Well this shouldnt be any problem. I suspect you dont
> >know how to set up the email routine since your asking.
> >
> >All you need to do is insert a sendmail script together with the
> >update of the mySQL database. You could use PHPs internal
> >functions for this, but Ill recommend you using PHPmailer which
> >is heavily documentet with tons of examples on how to use.
> >
> >The PHPmailer is located at sourceforge and you should find it
> >right away. It has to be the most elegant way I know of sending
> >emails from PHP scripts.
> >
> >And as a bonus, the PHPmailer is under active development so
> >you will most likely never run into problems using it, :)
> >
> >--
> >Kim Steinhaug
> >---
> >There are 10 types of people when it comes to binary numbers:
> >those who understand them, and those who don't.
> >---
> >
> >
> >"Redhat" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> > > I have created a simple form that dumps input information into a mysql
> > > database.  The person that I created it for said it would be nice if
it
> > > would also notify him by email that an entry was added to the
database.
> > > I have no idea where to begin with that - any ideas?
> > 

Re: [PHP-DB] removing space ?

2003-10-28 Thread Dan Brunner
Hello.

Use ltrim().

$image  = ltrim($data->JPG_Name);

echo $image;

Or use trim()



Or

http://www.php.net/manual/en/ref.strings.php





Dan

On Oct 28, 2003, at 4:11 PM, [EMAIL PROTECTED] wrote:

When I select data from my data base I have spaces on the lead side for
example the data that is stored is "  33.jpg".  Spaces included,
exclude the quotes, quotes are example only to show the spaces.


I would like to remove these spaces. Is there a way to do this?



Can it be done in the query?



Any help would be appreciated.



Larry Sandwick

Sarreid, Ltd.

Network/System Administrator

phone: (252) 291-1414 x223

fax  : (252) 237-1592



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


Re: [PHP-DB] Can't conect with mysql_connect(), please help.

2003-10-14 Thread Dan Brunner
Hello!!

Yes check to make sure mysqld is running.

ps -aux|grep mysql

If you don't see mysql, then start mysql.

service mysql start

If your running red hat.

Dan



On Oct 14, 2003, at 4:52 PM, [EMAIL PROTECTED] wrote:

  phpinfo() says:

  MySQL Support enabled

  MYSQL_SOCKET /var/lib/mysql/mysql.sock

but in fact the file /var/lib/mysql/mysql.sock doesn't exists.

So I understand that the first step is to check the configuration of 
MySQL,
is it?

"Dan Brunner" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
Hello!!

Does that file "/var/lib/mysql/mysql.sock" exist?!!?!?

Check to make sure mysql is running.



Dan

On Oct 14, 2003, at 4:34 PM, [EMAIL PROTECTED] wrote:

I'm starting to use MySQL, well, trying to, and I get the next 
message:

Warning: mysql_connect(): Can't connect to local MySQL server through
socket
'/var/lib/mysql/mysql.sock' (2)
The manual says that mysql_connect() can be called without arguments.
That's
what I'm doing.
What's wrong?

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


Re: [PHP-DB] Can't conect with mysql_connect(), please help.

2003-10-14 Thread Dan Brunner
Hello!!

Does that file "/var/lib/mysql/mysql.sock" exist?!!?!?

Check to make sure mysql is running.



Dan

On Oct 14, 2003, at 4:34 PM, [EMAIL PROTECTED] wrote:

I'm starting to use MySQL, well, trying to, and I get the next message:

Warning: mysql_connect(): Can't connect to local MySQL server through 
socket
'/var/lib/mysql/mysql.sock' (2)

The manual says that mysql_connect() can be called without arguments. 
That's
what I'm doing.

What's wrong?

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


Re: [PHP-DB] Re: textarea with multiple rows and mysql insert

2003-10-10 Thread Dan Brunner
What is your field length???

Varchar(10)??

You should set the column type to text.

Dan



On Oct 10, 2003, at 10:27 AM, [EMAIL PROTECTED] wrote:


I have a form that includes two text areas that span
multiple rows. The first textarea (rows=2, cols=50) is
used to insert a pretty long url, while the second
(rows=5, cols=50) is used for inserting free text
(comments).
When I process the form to create the mysql insert
statement, the values inserted for both those text
areas get cut off after the end of each row.
How can I get the script to process the full contents?
thanks

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread Dan Brunner
Hello!!

Are talking about the same "Post Question"???

On another words, what is being duplicated??

If not, you can use auto_increment.

Dan





On Wednesday, June 4, 2003, at 03:13  PM, [EMAIL PROTECTED] wrote:

I need to modify some company web pages that include a form for asking 
the
company departments questions, such as service dept, etc. As the forms 
are
currently built there is some field validation but no cookies. This 
info
is saved in a mysql database, problem is, there are duplicate entries,
every time an  end-user posts a question. What kind of code do I need 
to
add to these existing pages to prevent duplicate entries in the 
database?
(Manually scanning through and deleting dupes is a real drag.) And what
about cookies? Could I make use of these on these pages? I haven't 
worked
with cookies yet, so am not sure where to start with that part.
Thanks,
--
Chip

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


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


Re: [PHP-DB] Email an attached file

2003-05-29 Thread Dan Brunner
Then you should be able to use that function...

So are you storing the "Path" of the file in MYSQL or any other 
database?!?!!?

If not then replace

/-

$file2 = ("./images/$data->name");
//--

to reflect your path...



Dan



On Wednesday, May 28, 2003, at 02:34  PM, [EMAIL PROTECTED] 
wrote:

I am storing the file on my server.

-Original Message-
From: Dan Brunner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 2:42 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Email an attached file
Hello!!

  If your storing the file name, file type, in mysql; and are storing
the files on a server.
  (Which you should be doing!!!)


You could use this!!

//

$query = "SELECT * FROM Images WHERE Num = $num";
$result = mysql_query ($query, $db);
$data = mysql_fetch_object($result);
function sendfile($to, $subject, $text, $cc, $from, $file, $type) {
$content = fread(fopen($file,"r"),filesize($file));
$content = chunk_split(base64_encode($content));
$uid = strtoupper(md5(uniqid(time(;
$name = basename($file);
$text = stripslashes($text);
$subject = stripslashes($subject);
$header = "From: $from\nReply-To: $from\n";
$header .= "Cc: $cc\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/mixed; boundary=$uid\n";
$header .= "--$uid\n";
$header .= "Content-Type: text/plain\n";
$header .= "Content-Transfer-Encoding: 8bnoit\n\n";
$header .= "$text\n";
$header .= "\n";
$header .= "\n";
$header .= "--$uid\n";
$header .= "Content-Type: $type; name=\"$name\"\n";
$header .= "Content-Transfer-Encoding: base64\n";
$header .= "Content-Disposition: attachment; filename=\"$name\"\n\n";
$header .= "$content\n";
	$header .= "--$uid--";

	mail($to, $subject, "", $header);

}

$file2 = ("./images/$data->name");
$type = ("$data->filetype");
$mess .= ("\n");
$mess .= ("\n");
$mess .= ("\n");
$mess .= ("\n");
$mess .= ("Here is that Pic you wanted...");
sendfile($To, $sub, $mess, $cc, $From, $file2, $type);



//-

Of course all of the $To,$sub,etc...etc...etc...are from posting the
data from a form.


I think you can figure out the rest



Good luck!!



Dan Brunner



On Wednesday, May 28, 2003, at 01:12  PM, [EMAIL PROTECTED]
wrote:
www.phpclasses.org is your best bet.  there are plenty.  personally i
use
this one..http://phpclasses.com/browse.html/package/32.html
check out his site for examples.

hth
jd




"Marie Osypian"
<[EMAIL PROTECTED]   To:
<[EMAIL PROTECTED]>
llege.com>  cc:
Subject: [PHP-DB]
Email an attached file
05/28/2003 02:08 PM




I am using something like this example code below to send e-mail and
wondered if anyone could tell me how I could include a file also in
this
email if possible.
Thanks in advance.
Marie
EXAMPLE:

$myname = "Me Myself";
$myemail = "[EMAIL PROTECTED]";
$contactname = "Mister Contact";
$contactemail = "[EMAIL PROTECTED]";
$message = "hello from happy me";
$subject = "Included your file";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">\r\n";
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Just My Server";
mail($contactemail, $subject, $message, $headers);


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




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


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


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


Re: [PHP-DB] Email an attached file

2003-05-29 Thread Dan Brunner
Hello!!

 If your storing the file name, file type, in mysql; and are storing 
the files on a server.
 (Which you should be doing!!!)



You could use this!!

//

$query = "SELECT * FROM Images WHERE Num = $num";
$result = mysql_query ($query, $db);
$data = mysql_fetch_object($result);
function sendfile($to, $subject, $text, $cc, $from, $file, $type) {
$content = fread(fopen($file,"r"),filesize($file));
$content = chunk_split(base64_encode($content));
$uid = strtoupper(md5(uniqid(time(;
$name = basename($file);
$text = stripslashes($text);
$subject = stripslashes($subject);
$header = "From: $from\nReply-To: $from\n";
$header .= "Cc: $cc\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/mixed; boundary=$uid\n";
$header .= "--$uid\n";
$header .= "Content-Type: text/plain\n";
$header .= "Content-Transfer-Encoding: 8bnoit\n\n";
$header .= "$text\n";
$header .= "\n";
$header .= "\n";
$header .= "--$uid\n";
$header .= "Content-Type: $type; name=\"$name\"\n";
$header .= "Content-Transfer-Encoding: base64\n";
$header .= "Content-Disposition: attachment; filename=\"$name\"\n\n";
$header .= "$content\n";
	$header .= "--$uid--";

	mail($to, $subject, "", $header);

}

$file2 = ("./images/$data->name");
$type = ("$data->filetype");
$mess .= ("\n");
$mess .= ("\n");
$mess .= ("\n");
$mess .= ("\n");
    $mess .= ("Here is that Pic you wanted...");
sendfile($To, $sub, $mess, $cc, $From, $file2, $type);



//-

Of course all of the $To,$sub,etc...etc...etc...are from posting the 
data from a form.



I think you can figure out the rest



Good luck!!



Dan Brunner



On Wednesday, May 28, 2003, at 01:12  PM, [EMAIL PROTECTED] 
wrote:

www.phpclasses.org is your best bet.  there are plenty.  personally i 
use
this one..http://phpclasses.com/browse.html/package/32.html

check out his site for examples.

hth
jd




"Marie Osypian"
<[EMAIL PROTECTED]   To: 
<[EMAIL PROTECTED]>
llege.com>  cc:
Subject: [PHP-DB] 
Email an attached file
05/28/2003 02:08 PM





I am using something like this example code below to send e-mail and
wondered if anyone could tell me how I could include a file also in 
this
email if possible.

Thanks in advance.
Marie
EXAMPLE:

$myname = "Me Myself";
$myemail = "[EMAIL PROTECTED]";
$contactname = "Mister Contact";
$contactemail = "[EMAIL PROTECTED]";
$message = "hello from happy me";
$subject = "Included your file";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">\r\n";
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Just My Server";
mail($contactemail, $subject, $message, $headers);


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




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


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


Re: [PHP-DB] uploading

2002-11-05 Thread Dan Brunner
Hello...




...
...
...

	$pat = array("#", "@", "*", "#", "@", "$","'", "`");
	$w= '_';
	$pic_name2 = str_replace ($pat, $w, stripslashes($pic_name));

$query = "INSERT INTO Travel_Design (Travel_Design_Num, Season, Date, 
name, filesize, filetype ) VALUES ( '$Travel_Design_Num', '$Season', 
'$Date', '$pic_name2',  	'$pic_size', '$pic_type')";
exec ("cp '$pic' './images/$pic_name2'");

...
...
...
?>



$pic comes from a form...I strip out any unwanted junk( it's better 
when you want to display the file)I insert the Data to the 
Database, including the file's locationand copy the file where it 
belongs...

The actual file is uploaded into a temp directory..you have to copy 
or move the file from that spot to where you want it...At least with 
Linux...


Dan




On Tuesday, November 5, 2002, at 04:03  PM, [EMAIL PROTECTED] wrote:

I have been trying to get this to work as well, where I am lost is what
is the upload.php file supposed to contain, other than the below lines
that Edward was mentioning

Just lost
Thanks
Ryan

-Original Message-
From: Edward Peloke [mailto:epeloke@;echoman.com]
Sent: Tuesday, November 05, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] uploading

I am playing with uploading files. The names will then be stored in the
db.
I have a
simple form:


  Send these files:
  



Which calls a php file that just contains this:
copy($_FILES['userfile']['tmp_name'], "\ufiles\");

 This ufiles folder is under my htdocs folder in apache.  I have looked
through the help files in php.net but am just not getting it today.  
How
do
I simply upload the file?  I tried to move uploaded file function but
can't
seem to get that to work alsoany ideas would be greatly 
appreciated!

Thanks,
Eddie


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



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



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




Re: [PHP-DB] Need help urgent!!

2002-09-26 Thread Dan Brunner

Check your register_globals value in your PHP.INI!!

Dan


On Thursday, September 26, 2002, at 11:48  AM, [EMAIL PROTECTED] wrote:

> I'm using PHP4.2.2 Win with MySQL 3.2.52 Win and PHP doesn't pass vars 
> from
> 1 php to the other how i fix it?
>
> Thanks
>
>
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] Search Script

2002-04-25 Thread Dan Brunner

Hello!!

Your right!!

don't use = on the like part...I don't know what I was thinking!!!

Anyway here is the code right from my search page...

include("./navbar2.php");
$nav = new navbar;
$nav->numrowsperpage = 30;
$sql = "SELECT Print_Name, Art_Job_Number, Size, Item_Number FROM 
Table1 WHERE Print_Name LIKE '%$Print_Name%' ORDER BY $or $place";
$result = $nav->execute($sql, $db, "mysql");
$rows = mysql_num_rows($result);
for ($y = 0; $y < $rows; $y++){
$data = mysql_fetch_object($result);

That should do it!!

Dan


On Thursday, April 25, 2002, at 09:23 AM, [EMAIL PROTECTED] wrote:

> The query should read as below, without the = after the LIKE:
>
> $query = "SELECT uid, id, image, iname, quantity, type FROM
> {$config["prefix"]}_shop WHERE iname LIKE '%$shopsearch% ORDER BY
> iname'";
>
> HTH
>
> Maureen
>
>
> Jennifer Downey <[EMAIL PROTECTED]> said:
>
>> Hi all,
>>
>> I have been trying to build a search script for my site that deals 
>> with only
>> one table in my db.
>> As Julie Meloni pointed out look in the MySQL manual for LIKE clauses I
>> can't seem to locate that clause in ether
>> manual.
>> Dan Brunner gave me this to go on:
>>
>> $query = "SELECT uid, id, image, iname, quantity, type FROM
>> {$config["prefix"]}_shop WHERE  iname  LIKE = '%$shopsearch% ORDER BY
>> iname'";
>> $ret = mysql_query($query);
>> while(list($quantity)=mysql_fetch_row($ret))
>>
>> But I can't seem to get this to work. I have never worked with LIKE 
>> before
>> and would appreciate any help on this.
>>
>> Thanks Julie and Dan for your time and effort.
>>
>> Thanks all for your time and help
>> Jennifer
>>
>>
>> --
>> The sleeper has awaken
>>
>>
>> ---
>> Outgoing mail is certified Virus Free.
>> Checked by AVG anti-virus system (http://www.grisoft.com).
>> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> --
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] Search tutroial

2002-04-24 Thread Dan Brunner

Hello!!

Use LIKE in your WHERE clause...

You can also more then when Field

Example.

$query = "SELECT uid, id, image, iname, quantity, type FROM
{$config["prefix"]}_shop WHERE  iname  LIKE = '%$shopsearch% ORDER BY 
iname'";
   $ret = mysql_query($query);
   while(list($quantity)=mysql_fetch_row($ret))

Dan



On Wednesday, April 24, 2002, at 01:47 PM, [EMAIL PROTECTED] wrote:

> By the way SELECT uid, id, image, iname, quantity, type, user where it 
> shows
> below that user isn't in the query- it is there in my editor.
> I just forgot to put it in before sending.
> Jennifer
> "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> This is basically what I am trying to do
>> if($search)
>> {
>> $query = "SELECT uid, id, image, iname, quantity, type FROM
>> {$config["prefix"]}_shop WHERE  iname = $shopsearch";
>>   $ret = mysql_query($query);
>>   while(list($quantity)=mysql_fetch_row($ret))
>>
>>$name = $row['user'];
>>echo $name;
>>
>> }else{
>>
>> echo "";
>> echo "Search Shops> value=\"\">";
>> echo "";
>>
>> }
>>
>> This is a dump of the table
>>
>> uid int(10) NOT NULL default '0',
>>   id int(5) NOT NULL default '0',
>>   iname varchar(50) NOT NULL default '',
>>   image varchar(100) NOT NULL default '',
>>   quantity int(10) unsigned NOT NULL default '1',
>>   type varchar(20) NOT NULL default '',
>>   price int(6) NOT NULL default '0',
>>   user varchar(50) NOT NULL default '',
>>   KEY uid (uid)
>>
>> Just a note this works throughout my site and I have no trouble with 
>> it:
>> {$config["prefix"]}_shop
>> I'm not trying to be rude but I get sick of it when people tell me that
> this
>> is the problem when it has nothing to do with the question I am asking.
>>
>> Thanks for your time and help
>> Jennifer
>>
>> "Julie Meloni" <[EMAIL PROTECTED]> wrote in message
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>>
>>> JD> Would someone kindly point me to a tutorial on designing a search
>> script for
>>> JD> mysql db.
>>> JD> I have tried to build one but can't get anywhere with it.
>>>
>>> Well, that would depend on what and how you are searching, your table
>>> structure, etc.  Essentially, every SELECT query is a "search".
>>>
>>> If you post more information about your table(s) structure, your
>>> search methods and the search parameters, people would probably be
>>> able to help you.
>>>
>>>
>>> - Julie
>>>
>>> --> Julie Meloni
>>> --> [EMAIL PROTECTED]
>>> --> www.thickbook.com
>>>
>>> Find "Sams Teach Yourself MySQL in 24 Hours" at
>>> http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20
>>>
>>
>>
>> ---
>> Outgoing mail is certified Virus Free.
>> Checked by AVG anti-virus system (http://www.grisoft.com).
>> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>>
>>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] auto-increment question

2002-04-23 Thread Dan Brunner

Hello!!

ALTER TABLE table1 AUTO_INCREMENT = 1000;

That should do it...

You can use that anytime..

Dan

On Tuesday, April 23, 2002, at 12:21 AM, [EMAIL PROTECTED] wrote:

> Hi all,
>
> I'm wondering if there is a way to start an auto-increment field at a 
> number
> other than 1. I'm working on a table meant to store large amounts of 
> users,
> each with their own unique ID, but my employer wants the UIDs to be a 
> four-
> digit number, rather than starting at 1 -- but they still need to auto-
> increment. Can this be done, or do I need to find a workaround (and if 
> so,
> can anyone suggest anything?)
>
> Thanks in advance,
>
> Dan
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] AOL Problems

2002-04-09 Thread Dan Brunner

Hello!!


So is the old value of "new location" not being passed to the next page?
OR
Is the new "category" variable not being passed to the next page??



Dan



On Tuesday, April 9, 2002, at 12:44 PM, [EMAIL PROTECTED] wrote:

> Hi group,
>
> I wonder if anyone can help me with some problems I have just found out 
> with a website we have just put together.
>
> Our client unfortuntately uses the AOL browser on a MAC, so he is 
> running version 5 of AOL for the mac.
>
> Now we have a database driven website we have put together, and the 
> problem occurs as the values do not seem to be getting sent to the 
> database and so therefore he is not getting the correct results that he 
> should be.
>
> We have a bookstore, where you intially select your location in the 
> world, and then also a category to select the books.
>
> This is fine as it queries the database and returns the results to him. 
> Then on the results page we have the category list so that they can go 
> to another category, they do not have to select a new location as the 
> values are already carried over each page. But what happens is that 
> when they choose the new category and click submit, it does not change 
> anything on the page, so they get the same results even though they 
> have sent a new value to the server.
>
> Has anybody had this problem, and is there a fix?
>
> Help would be appreciated as this is the last problem we have to fix 
> before this site can go live.
>
> Many thanks
>
>
> Barry Zimmerman
> www.bzdpltd.co.uk
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] Pop up are you sure...

2002-04-01 Thread Dan Brunner

Hello!!

What I was able to do was this

On every form page I have, I have a checkbox that is labeled "Ok To 
Save", that the user would check or not..

I would then pass that variable to the next page and check to see if the 
value was true or not...

If it is true then it would continue to insert the data into the 
database...

If not then it would display the pop up messages

The code looks something like this on the parse page.(in my case it 
is the insert3.php file)








\n");
echo ("\n");
exit();
}


require ("functions/java.inc");
echo ("\n");
echo ("");

?>

It will popup a messages about not checking that checkboxAnd tell 
you have an error...

I too messed around trying to just using PHP, but I gave up using just 
PHP, Javascript plays nice with PHP anyway!!



Dan











On Monday, April 1, 2002, at 12:57 PM, [EMAIL PROTECTED] wrote:

>  I was close. :)
>
> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 01, 2002 10:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Pop up are you sure...
>
>
> On Tuesday 02 April 2002 01:30, Jonathan Hilgeman wrote:
>> You're so negative, Jason. :)
>
> No, my answer was just short and to the point ;-)
>
>> Long answer, Dave, it wouldn't be wise to do this via Javascript.
>
> My long answer was going to be: it's possible to do it in PHP, but then 
> it
> would not look like a pop-up window, and it requires a trip back to the
> server.
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> Love is being stupid together.
>   -- Paul Valery
> */
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP-DB] include() statement hell!

2002-03-27 Thread Dan Brunner

Has anybody told him to check his PHP.INI???

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 27, 2002 6:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] include() statement hell!

#1. You may want to double-check the path where you're calling it from
in
case you're working with subdirectories. 

Let's saying you access a page at www.domain.com/page.php which calls
www.domain.com/includes/header.inc.
Then, header.inc includes the dblib.inc file at
www.domain.com/includes/dblib.inc. However, the include's base directory
will still be in page.php - the directory won't change to includes, so
for
header.inc to include dblib.inc, it has to say:
  include("includes/dblib.inc");
NOT
  include("dblib.inc");
Otherwise, it will be trying to include www.domain.com/dblib.inc because
the
page that started the whole chain reaction of includes is located at
www.domain.com/page.php

#2. If you have error reporting turned off, and there is a parsing error
in
your files, the page may just die without giving a reason. Try turning
off
any error reporting and also access those include files like userlib.inc
directly in your web browser to see if PHP reports any errors. You may
need
to change the extension to something like userlib.inc.php for the web
server
to recognize the request correctly. 

#3. Please give us a little more detail on the errors you're getting
(any
specific messages would be nice).

- Jonathan

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 3:42 PM
To: 'Brad Melendy'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] include() statement hell!


did you start each include file with:


If not, PHP treats the code within as straight text

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] include() statement hell!


Ok, I've spent some time reading the docs at php.net and I'm still
confused.

After a couple hours, I have an include file working with a statement
like:

include ("dblib.inc");

However, to add to my confusion, I've got a second include file
statement on
the next line:

include ("userlib.inc");

And that doesn't work.

Most crazy of all, if I just put the darn functions all in the PHP file
that
is trying to call the include files, everything works perfectly.

So far I have my include_path line in the pho.ini file set to no value
since
I'm just using include files that exist in the same directory as the
calling
php file.  this after I could NOT get the files to be properly
recognized
from their own include directory.  As far as I'm concerned, you should
be
able to include a relative path with the included filename and have it
work.
Too bad that doesn't work in PHP.

So, long story short, I'm about to give up on include statements and
just
copy and paste my functions all over the place.  Does anyone have any
ideas
why this is so difficult for me?  What am I missing?  This stuff is easy
in
ASP but PHP is giving me serious heart-ache.  :-(

Thanks for any tips or suggestions.

Brad



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

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

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



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




Re: [PHP-DB] records into an editable box

2002-03-06 Thread Dan Brunner

Hello!!

Do you mean a textarea??

And you want to populate the "textarea" with the data, right?


Dan


On Wednesday, March 6, 2002, at 01:34 AM, [EMAIL PROTECTED] wrote:

> How would I change this sql statement to pull the db table and display 
> it
> within an editable box within a form?  Any help or tutorials would be 
> great.
>  $result = mysql_query("SELECT $table FROM $field",$dbh) or die("Could 
> not
> execute query, please try again later");
> echo "text:\n";
> printf(mysql_result($result,"wel_area"));
> ?>
> Thanks in advance,
> Jas
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP-DB] any php/Linux gurus out there?

2002-03-04 Thread Dan Brunner

Hello!!

First uninstall your old version of php(php-4.0.6-9.7.0)

Then install the new RPM

If you're using the Red Hat update thingy...

Or download the source and recompile it!!




Dan



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 04, 2002 5:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] any php/Linux gurus out there?

Hi

I am running the security upgrade and am getting the following error
when I
run the RPM
The install is RH 7.0 and was pre-installed. I had assumed that the RPMs
from Redhat would match the pre installed version, as it was standard.

I am a humble programmer (and part time sys admin!), rather than a
Linux/RH
guru, so would appreciate some advice. What is the best way to deal with
this ?


error: failed dependencies:
libcrypto.so.1 is needed by php-4.0.6-9.7.0
libmm.so.11 is needed by php-4.0.6-9.7.0
libssl.so.1 is needed by php-4.0.6-9.7.0
libcrypto.so.1 is needed by php-imap-4.0.6-9.7.0



---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

sql table


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



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




Re: [PHP-DB] easy date format question

2002-03-04 Thread Dan Brunner

Hello!!

it should be

$today = Date("Y"-"m"-"d");


Dan


On Friday, March 1, 2002, at 04:50 PM, [EMAIL PROTECTED] wrote:

> should be simple as pie, of course, but i can't find a straightforward
> syntax example in the documentation. i'm trying to change the PHP date
> format to mysql's.
>
> my code:
> $today = date("MMDD");
> $sql = "INSERT into table (date) values ('$today')";
> and so on...
>
> is filling the date field with zeros, instead of 2002-02-28
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP-DB] accessing system cmds w/ PHP

2002-02-27 Thread Dan Brunner

Hello...

Try exec()


I know it works moving files.


Dan



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 27, 2002 7:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] accessing system cmds w/ PHP

Can anyone tell me how to access linux system commands using php. Tried
the
system() cmd but no luck. Does it require a wrapper to work?Thanks,
JJ


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



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




Re: [PHP-DB] Re: forced page links...

2002-02-27 Thread Dan Brunner

Hello!!

What I would do is have both the 2 page and the last page on the the 
same page!!

All my pages are only two...a form page and a processing page...that's 
it


However

You could also have a variable pass from page to page, like a hidden 
variable, either in a form, or with cookies.

And check for that variable every page with an If...else..statement.

like

If (empty($CheckPLEASE){
echo "Sorry You are out of order";
exit();
}else{
echo "hey your good to go!!";
}   

And so on and so on...


Dan



On Wednesday, February 27, 2002, at 02:03 AM, [EMAIL PROTECTED] wrote:

> Can you accomplish this without having the user logged in?  I am 
> unconcerned
> with whether or not the user has logged in, I simply need the user to 
> not be
> able to bypass a page with a form to go directly to the end page which 
> will
> connect and store the form contents into a db.
> Thanks in advance,
> Jas
> "Lerp" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hi there :) I use session variables to do this, once the user has 
>> logged
> in
>> and you know they are who they say they are, set a session variable 
>> using
>>
>> session_register("isloggedin");
>> $isloggedin = "yes";
>>
>>
>> And at the top of every page you want protected simply do a check to 
>> see
> if
>> it is set or not. Below code checks to see if that var is set and if 
>> not
> it
>> redirects them to another page.
>>
>> 
>> >
>> if (!isset($HTTP_SESSION_VARS["islogged"])){
>>
>> header("Location:index.php");
>> }
>>
>> ?>
>>
>>
>> Hope this helps, Joe :)
>>
>>
>> "Jas" <[EMAIL PROTECTED]> wrote in message
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>> I am wondering if there is a good tutorial on how to use php to make
> users
>>> come from a page before they can access another.  For instance, say 
>>> you
>> have
>>> one page called index.php which contains a form that once filled in
> links
>> to
>>> a confirmation page to verify the users data was entered correctly 
>>> then
>> from
>>> there links to a page that stores the users data into a database 
>>> table.
>> The
>>> problem I would like to alleviate is to make sure the users cannot 
>>> just
>> type
>>> in the name of the last page in the url and put a blank entry into the
>>> database.  I have read a few tutorials on using sessions but I am
> unclear
>> on
>>> how the use of sessions would require the user to visit each page in
>>> succession.  Thanks in advance,
>>> Jas
>>>
>>>
>>
>>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] optimizing script...

2002-02-15 Thread Dan Brunner

Hello...

Try this...


$pat = array("\", "@", "*", "&", "%");

$with = (_) \\What ever you want...

$car_year = str_replace ($pat, $with, stripslashes($car_year));

echo $car_year;

This would work with ONE VARIABLE...


I suppose maybe you could make the 
Variables($car_type,$car_model,$car_year) into an array. Then 
ereg_replace the new array,
then turn it back to the variables...I think it's explode...and 
implode


Never tried it



Good Luck



Dan



On Thursday, February 14, 2002, at 10:57 PM, [EMAIL PROTECTED] wrote:

> I have a script that prevents invalid characters from being passed 
> from a
> html form to a mysql database using php and I am wondering if there is 
> a way
> to condense it so instead of declaring the ereg_replace for each field 
> in
> the html form, to simply use one function to remove invalid characters 
> and
> html markup from all the fields in the form at once... here is my code, 
> any
> insight would be great.  I am not asking you to do it for me, I just 
> want to
> know how and what the best way to condense it would be. Thanks in 
> advance.
> Jas
>
> # - Error correction for car_type field 
> $car_type = ereg_replace ("\"", "&q&", $car_type);
> $car_type = ereg_replace ("'", "&a&", $car_type);
> $car_type = ereg_replace ("%", "&p&", $car_type);
> $car_type = ereg_replace ("", "&bs&", $car_type);
> # - Error correction for car_model field 
> $car_model = ereg_replace ("\"", "&q&", $car_model);
> $car_model = ereg_replace ("'", "&a&", $car_model);
> $car_model = ereg_replace ("%", "&p&", $car_model);
> $car_model = ereg_replace ("", "&bs&", $car_model);
> # - Error correction for car_year field 
> $car_year = ereg_replace ("\"", "&q&", $car_year);
> $car_year = ereg_replace ("'", "&a&", $car_year);
> $car_year = ereg_replace ("%", "&p&", $car_year);
> $car_year = ereg_replace ("", "&bs&", $car_year);
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] Searching Documents

2002-02-08 Thread Dan Brunner

Hello!!!

Use LIKE in your Select statement...Like this!!


$sql = "Select File_Name From Table2 WHERE File_Name LIKE '%$Search%'";

$Search would come from a form...


Dan


On Friday, February 8, 2002, at 09:06 AM, [EMAIL PROTECTED] wrote:

> I was wondering if there is a way to search documents.
>
> Scenario:
>
> I have a application where it uploads MS Word documents to a server and
> holds the documents location in the database.  What I want is to be 
> able to
> search those Word documents via keywords.
>
> Is this possible with PHP?
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP-DB] Re: FIle Uploading to database

2002-02-04 Thread Dan Brunner

GOOD

What was the problem!?!?


Dan


On Monday, February 4, 2002, at 01:44 PM, [EMAIL PROTECTED] wrote:

> Ok,
>
> I got it woohoo!!!
>
> It works!
>
> Thanks for all your help
>
> -Original Message-
> From: Dan Brunner [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 10:35 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Re: FIle Uploading to database
>
>
> Does the file come from a Form??
>
> Your hosting provider...might be the problem.
>
> Dan
>
>
> On Monday, February 4, 2002, at 09:57 AM, [EMAIL PROTECTED] wrote:
>
>> I changed it to its absolute path... It resides with my hosting
>> provider...
>>
>> I removed the
>>
>> $pat = array("#", "@", "*", "&", "%", "@","$","'","`");
>>  $w= '_';
>>  $pic_name2 = str_replace ($pat, $w, stripslashes($pic_name));
>>
>> To see if the file is being uploaded...
>>
>> Here is the actual code:
>>
>> $db = @mysql_select_db("williamsen", $connection) or die("Could not
>> select database");
>> $sql ="INSERT INTO Canidate (id, FirstName, LastName, Industry,
>> Address1, Address2, City, State, Zip, LocationPref, Phone, Email,
>> ResumeUp)
>>  VALUES
>> (\"$id\", \"$FirstName\", \"$LastName\", \"$Industry\", \"$Address1\",
>> \"$Address2\", \"$City\", \"$State\", \"$Zip\", \"$LocationPref\",
>> \"$Phone\", \"$Email\", \"$userfile\" )";
>>  $result = @mysql_query($sql,$connection) or die("OOPS!!  Couldn't
>> Execute Query!");
>>
>> exec("cp '$userfile', 'home/sites/site190/web/resumes/$userfile'");
>>
>> The $sql query needed the $connection in there for it to work
>>
>> -Original Message-
>> From: Dan Brunner [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, February 04, 2002 9:46 AM
>> To: [EMAIL PROTECTED]
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [PHP-DB] Re: FIle Uploading to database
>>
>>
>> Make sure the path name is correct
>>
>> Let's say you compiled apache with this prefix /web
>>
>> you must have the full path name to work...like this
>>
>> exec("cp '$ResumeUp' '/web/htdocs/resumes/$ResumeUp2'");
>>
>> Also check permissions...
>>
>> I think that was my problem at first too!!!
>>
>>
>> You can also do debug the script.
>>
>> Like this
>>
>> echo $ResumeUp;
>>
>> That should print the tmp file you form created...
>>
>> Let me know...
>>
>>
>> Once this pasts...It works really well...
>>
>>
>> Dan
>>
>>
>>
>> On Monday, February 4, 2002, at 09:35 AM, [EMAIL PROTECTED] wrote:
>>
>>> The INSERT statement works fine now, but the file isn't being
>> uploaded.
>>> I cannot figure out why
>>>
>>> -Original Message-
>>> From: Dan Brunner [mailto:[EMAIL PROTECTED]]
>>> Sent: Monday, February 04, 2002 7:54 AM
>>> To: [EMAIL PROTECTED]
>>> Cc: [EMAIL PROTECTED]
>>> Subject: Re: [PHP-DB] Re: FIle Uploading to database
>>>
>>>
>>> Hey did you get it to work yet?!?!
>>>
>>>
>>> Dan
>>>
>>>
>>> On Sunday, February 3, 2002, at 09:08 PM, [EMAIL PROTECTED] wrote:
>>>
>>>> Umm..
>>>>
>>>> SET parameter is for the UPDATE query
>>>>
>>>>
>>>> "Adam Royle" <[EMAIL PROTECTED]> wrote in message
>>>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>>>> You missed the SET parameter in your query... example is below...
>>>>>
>>>>> $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus...
>>>>>
>>>>> Adam
>>>>>
>>>>> -Original Message-
>>>>> From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
>>>>> Sent: Monday, February 04, 2002 11:06 AM
>>>>> To: [EMAIL PROTECTED]
>>>>> Subject: Re: FIle Uploading to database
>>>>>
>>>>>
>>>>> Well...  thanks to Dan Burner for the script...  BUT
>>>>>
>>>>> I cannot get this friggin INSERT statement to execute..  which
> craps
>>>>> out..
>>>>> I cannot figure it out.  I have been staring at it for about an
> hour
>>>>> and I
>>>>> still cannot figure it out
>>>>>
>>>>> here it is:
>>>>>
>>>>> $db = @mysql_select_db($db_name, $connection) or die("Could not
>>> select
>>>>> database");
>>>>> $query = "INSERT INTO Canidate(FirstName, LastName, Industry,
>>> Address1,
>>>>> Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp)
>>>>> VALUES
>>>>> ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2',
>>>>> '$City',
>>>>> '$State', '$Zip', '$LocationPref', '$Phone', '$Email',
>>> '$ResumeUp2')";
>>>>> $result = @mysql_query($query, $connection) or die("could not
>> execute
>>>>> query");
>>>>> $pat = array("#", "@", "*", "&", "%", "@","$","'","`");
>>>>> $w= '_';
>>>>> $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp));
>>>>> exec("cp '$ResumeUp' '/resumes/$ResumeUp2'");
>>>>> ?>
>>>>>
>>>>> it errors out on the $result "could not execute query"
>>>>>
>>>>> Let me know if you need more info!
>>>>>
>>>>> Thank you!
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> PHP Database Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>
>>>
>>
>>
>
>


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




Re: [PHP-DB] Re: FIle Uploading to database

2002-02-04 Thread Dan Brunner

Make sure the path name is correct

Let's say you compiled apache with this prefix /web

you must have the full path name to work...like this

exec("cp '$ResumeUp' '/web/htdocs/resumes/$ResumeUp2'");

Also check permissions...

I think that was my problem at first too!!!


You can also do debug the script.

Like this

echo $ResumeUp;

That should print the tmp file you form created...

Let me know...


Once this pasts...It works really well...


Dan



On Monday, February 4, 2002, at 09:35 AM, [EMAIL PROTECTED] wrote:

> The INSERT statement works fine now, but the file isn't being uploaded.
> I cannot figure out why
>
> -Original Message-
> From: Dan Brunner [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 7:54 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Re: FIle Uploading to database
>
>
> Hey did you get it to work yet?!?!
>
>
> Dan
>
>
> On Sunday, February 3, 2002, at 09:08 PM, [EMAIL PROTECTED] wrote:
>
>> Umm..
>>
>> SET parameter is for the UPDATE query
>>
>>
>> "Adam Royle" <[EMAIL PROTECTED]> wrote in message
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>> You missed the SET parameter in your query... example is below...
>>>
>>> $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus...
>>>
>>> Adam
>>>
>>> -Original Message-
>>> From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
>>> Sent: Monday, February 04, 2002 11:06 AM
>>> To: [EMAIL PROTECTED]
>>> Subject: Re: FIle Uploading to database
>>>
>>>
>>> Well...  thanks to Dan Burner for the script...  BUT
>>>
>>> I cannot get this friggin INSERT statement to execute..  which craps
>>> out..
>>> I cannot figure it out.  I have been staring at it for about an hour
>>> and I
>>> still cannot figure it out
>>>
>>> here it is:
>>>
>>> $db = @mysql_select_db($db_name, $connection) or die("Could not
> select
>>> database");
>>> $query = "INSERT INTO Canidate(FirstName, LastName, Industry,
> Address1,
>>> Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp)
>>> VALUES
>>> ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2',
>>> '$City',
>>> '$State', '$Zip', '$LocationPref', '$Phone', '$Email',
> '$ResumeUp2')";
>>> $result = @mysql_query($query, $connection) or die("could not execute
>>> query");
>>> $pat = array("#", "@", "*", "&", "%", "@","$","'","`");
>>> $w= '_';
>>> $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp));
>>> exec("cp '$ResumeUp' '/resumes/$ResumeUp2'");
>>> ?>
>>>
>>> it errors out on the $result "could not execute query"
>>>
>>> Let me know if you need more info!
>>>
>>> Thank you!
>>>
>>>
>>>
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>


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




Re: [PHP-DB] Re: FIle Uploading to database

2002-02-04 Thread Dan Brunner

Hey did you get it to work yet?!?!


Dan


On Sunday, February 3, 2002, at 09:08 PM, [EMAIL PROTECTED] wrote:

> Umm..
>
> SET parameter is for the UPDATE query
>
>
> "Adam Royle" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> You missed the SET parameter in your query... example is below...
>>
>> $query = "INSERT INTO Canidate SET (FirstName, LastName, Indus...
>>
>> Adam
>>
>> -Original Message-
>> From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, February 04, 2002 11:06 AM
>> To: [EMAIL PROTECTED]
>> Subject: Re: FIle Uploading to database
>>
>>
>> Well...  thanks to Dan Burner for the script...  BUT
>>
>> I cannot get this friggin INSERT statement to execute..  which craps 
>> out..
>> I cannot figure it out.  I have been staring at it for about an hour 
>> and I
>> still cannot figure it out
>>
>> here it is:
>>
>> $db = @mysql_select_db($db_name, $connection) or die("Could not select
>> database");
>> $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1,
>> Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) 
>> VALUES
>> ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', 
>> '$City',
>> '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')";
>> $result = @mysql_query($query, $connection) or die("could not execute
>> query");
>> $pat = array("#", "@", "*", "&", "%", "@","$","'","`");
>> $w= '_';
>> $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp));
>> exec("cp '$ResumeUp' '/resumes/$ResumeUp2'");
>> ?>
>>
>> it errors out on the $result "could not execute query"
>>
>> Let me know if you need more info!
>>
>> Thank you!
>>
>>
>>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP-DB] FIle Uploading to database

2002-02-03 Thread Dan Brunner

Hello!!!

You can do something like this


$pat = array("#", "@", "*", "&", "%", "@","$","'","`");
$w= '_';
$pic_name2 = str_replace ($pat, $w, stripslashes($pic_name));



$query = "INSERT INTO Travel_Design (Tavel_Design, Design_Name,
Season, Date, name, filesize, filetype ) VALUES ( '$Tavel_Design',
'$Design_Name', '$Season', '$Date', '$pic_name2', '$pic_size',
'$pic_type')";



exec("cp '$pic' '/images/$pic_name2'");



The First part is for taking out certain characters.

The Second is for inserting the data...Including the File parameters.

The Third part is the command to cp the TMP file where it needs to
be...with the file name of $pic_name2...

All you're storing is the Pictures Name, Size, and Type



And you would do something like this for the  tag...


...
echo ("\n");
... 

$data->name is the mysql field for the Picture Name..


I use mysql_fetch_object for retrieving my data...I'm sure it would work
for mysql_fetch_array and mysql_fetch_row.


I run Linux...so I don't know if the exec() will work if your on
windoze


Good Luck!!!


Dan




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 03, 2002 4:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] FIle Uploading to database

I don't want the file to be stored in the database, but its location.

What I want to do:

Upload a file, it gets stored on the webserver, but its location on the
server is stored in the database.

Where do I look for something like this?

What data type would I use to store the URL or file location?

Thank you



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



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




Re: [PHP-DB] help! sqlserver only returns 256 from varchar types

2002-01-25 Thread Dan Brunner

If you need something that big

Use a TEXT type instead.



Dan


On Friday, January 25, 2002, at 01:35 PM, [EMAIL PROTECTED] wrote:

> thanks for your reply. It's 5000.
>
>
>
> Kevin Won
> -
> ITG Web Developer,
> Systems Administrator
> Oregon Health Sciences University
> (503) 418-4282
> cell: (503) 913-5367
> page: x15897
> fax: (503) 494-1888
>
>
>
>
>>>> Dan Brunner <[EMAIL PROTECTED]> 01/25/02 11:31AM >>>
> Hello!!!
>
> What is the Length of the varchar field,  in your database???
>
>
> Dan
>
>
> On Friday, January 25, 2002, at 01:22 PM, [EMAIL PROTECTED] wrote:
>
>> I'm having a problem with varchar fields out of mssql which are only
>> returning value lenghts < = 256 characters.
>>
>> I know that the php.ini setting in  mssql for textlength must be set to
>> get more than 4096 chars, I've set this value higer and my TEXT types
>> return correctly,  but my varchar fields are still truncated to <=
>> 256. ..
>>
>> is there another setting for the php.ini for returning longer length
>> varchar type fields???
>>
>> thanks
>>
>>
>>
>> Kevin Won
>> -
>> ITG Web Developer,
>> Systems Administrator
>> Oregon Health Sciences University
>> (503) 418-4282
>> cell: (503) 913-5367
>> page: x15897
>> fax: (503) 494-1888
>>
>>
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: php-list-
>> [EMAIL PROTECTED]
>>
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] help! sqlserver only returns 256 from varchar types

2002-01-25 Thread Dan Brunner

Hello!!!

What is the Length of the varchar field,  in your database???


Dan


On Friday, January 25, 2002, at 01:22 PM, [EMAIL PROTECTED] wrote:

> I'm having a problem with varchar fields out of mssql which are only 
> returning value lenghts < = 256 characters.
>
> I know that the php.ini setting in  mssql for textlength must be set to 
> get more than 4096 chars, I've set this value higer and my TEXT types 
> return correctly,  but my varchar fields are still truncated to <= 
> 256. ..
>
> is there another setting for the php.ini for returning longer length 
> varchar type fields???
>
> thanks
>
>
>
> Kevin Won
> -
> ITG Web Developer,
> Systems Administrator
> Oregon Health Sciences University
> (503) 418-4282
> cell: (503) 913-5367
> page: x15897
> fax: (503) 494-1888
>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Resource Id #2

2002-01-23 Thread Dan Brunner

AHAHAHHAHA

AHHAHAHAH


Dan


On Wednesday, January 23, 2002, at 02:19 PM, 
[EMAIL PROTECTED] wrote:

> Dan,
>
>> Good, I'm glad it worked!!!
>>
>> I see a lot of people using mysql_fetch_array().
>>
>> Which is fine...But I'm more into Object Oriented programming...and
>> that's why I always use mysql_fetch_object()
>
>
> hey this is a family show - but I guess 'what you do in the privacy 
> of' ...
>
> - and I'm just plain object-ionable, so I favor mysql_fetch_assoc()


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Resource Id #2

2002-01-23 Thread Dan Brunner

Good, I'm glad it worked!!!

I see a lot of people using mysql_fetch_array().

Which is fine...But I'm more into Object Oriented programming...and 
that's why I always use mysql_fetch_object()

Good luck!!!


Dan


On Wednesday, January 23, 2002, at 11:45 AM, [EMAIL PROTECTED] wrote:

> My thanks for your quick response!
>
> Here's the problem I'm dealing with:
>
> I am inserting info with a unique identifier that auto-increments, then 
> take
> that ID and place it into another table for later reference.
>
> I was trying to use something like:
>
> $query="select var1 from table1 where var2='$var3'
> and var4='$var5'";
>
> $somevar=mysql_query($query) or die.. yada yada
> echo $somevar;
>
> I tried your code, and it works wonderfully!  Thanks so much. :)
>
> J. Wharton
> [EMAIL PROTECTED]
>
> - Original Message -
> From: "Dan Brunner" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 12:21 PM
> Subject: Re: [PHP-DB] Resource Id #2
>
>
>> Use something like this...
>>
>> ...
>> ...
>> ...
>> $rows = mysql_num_rows($result);
>> for ($y = 0; $y < $rows; $y++){
>> $data = mysql_fetch_object($result);
>>
>> echo $data->Field_Name;
>> ...
>> ...
>> ...
>>
>> }
>>
>>
>> A Little more code would Help!!!
>>
>>
>>
>>
>> On Wednesday, January 23, 2002, at 10:56 AM, [EMAIL PROTECTED] wrote:
>>
>>> I'm having a problem with retrieving data from MySQL databases. I can
>>> input
>>> with no problems, but when I try to pull the data back out (single
>>> field)
>>> and echo it I get something showing up saying Resource Id #2.  Any
>>> ideas?
>>>
>>>
>>>
>>>
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>> To contact the list administrators, e-mail: php-list-
>>> [EMAIL PROTECTED]
>>>
>>
>>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Looking for a JavaScript routine built by PHP and populated from MySQL

2001-11-08 Thread Dan Brunner

Hello!!

So you have a page that show pics and you want to have something that 
show the next and back url...right???


Dan


On Thursday, November 8, 2001, at 04:23 PM, Doug Daulton wrote:

> Hello,
>
> I need to build a chunk of code which creates a click through view of 
> all
> pictures in a given directory.  The URL for each image is stored in a 
> MySQL
> table as part of the image upload routine.  I am thinking there would 
> be PHP
> routine that says something like ...
>
> 1. (PHP) - For every  create an array filled with product image
> URLs
> 2. (JavaScript) - Display array value(av) 1 ... assign av2 as href for 
> "next
> button"
> 3. (JavaScript) - In click next, display av2, set href for "next" to 
> av3,
> set href for "previous" to av1
> 4. (JavaScript) - At end of array, reset next to av1 (create loop)
>
> Does that description make sense?  Has anyone already written a similar
> beast?  I am in a time crunch, any and all help is appreciated.
>
> Regards,
>
> Doug Daulton
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] i know i caused u a headache:)

2001-09-26 Thread Dan Brunner

Hello!!

Where does your IF Statement get its condition???


After looking at the Function validate(), you don't have a category 
until later in the code. You use validate() to check the values after 
the click the submit button(Add Item). Right???

One thing you could do is...Since it looks like only 
$category=Printer...opens a new window...have a variable all ready equal 
to Printer...in store1.php

Or does $category= a bucnh of things...and you just put in Printer

Or I'm I missing something...


Dan




On Wednesday, September 26, 2001, at 08:36 AM, its me wrote:

> i know guys what u rtalking about but u can't see the problem:
> the problem is this ?brand=
> this something is value in javascript
> or value of a form field in same page called
> 
> but i can't make echo $category as the form isn't posted
> there is no submit button,there is a normal button when clicked
> there is a new window opened(an already existing .php file)
> and i wanna pass a value to it
>
>
>
>
> here is the whole thing:
>
>
>
>  require("VALIDATE.PHP");
> ?>
> 
>
> 
> upload  brand  logo
> 
> <!--
>
> function validate()
>   {
>
> if (document.forms[0].category.selectedIndex ==0)
> {
>   alert("Please choose category.");
>   document.forms[0].category.focus();
>   return;
> }
>
> if (document.forms[0].subcategory.selectedIndex == 0)
> {
>   alert("Please choose  sub-category.");
>   document.forms[0].subcategory.focus();
>   return;
> }
> x=document.forms[0].subcategory.selectedIndex
> y= document.forms[0].subcategory.options[x].text
> if(y=="Printers" )
>  {
> open("store1.php?brand=<?php echo $category; ?>","newWindow")
>
>  return
>  }
>
>
>   }
>
>
>  var ComputersArray =  new Array("('Select Sub-category','',true,true)",
> "('Desktops')",
> "('Notebooks')",
> "('Printers')",
> "('Monitors')");
>
> function populateCountry(inForm,selected) {
> var selectedArray = eval(selected + "Array");
> while (selectedArray.length < inForm.subcategory.options.length) {
> inForm.subcategory.options[(inForm.subcategory.options.length - 1)] = 
> null;
> }
> for (var i=0; i < selectedArray.length; i++) {
> eval("inForm.subcategory.options[i]=" + "new Option" + 
> selectedArray[i]);
> }
> if (inForm.category.options[0].value == '') {
>
> if ( navigator.appName == 'Netscape') {
> if (parseInt(navigator.appVersion) < 4) {
> window.history.go(0);
> }
> else {
> if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
> window.history.go(0);
> }
>  }
>   }
>}
> }
>
> -->
> 
> 
>
> 
>
>  
>  enctype="multipart/form-data">
> 
>   
>   
> 
>   Choose 
> brand name
>size="1" name="brand"><
>   No specific brand
>require("CONNECT.PHP");
> $sql="select distinct brand from brands
> where companyname='$valcompanyname' ";
> $result=mysql_query($sql,$conn);
> $num=mysql_num_rows($result);
> $cur=0;
> while($num> $cur)
> {
> $row=mysql_fetch_array($result);
>     $brand=$row["brand"];
> echo "$brand";
> $cur++;
> }
>  ?>
>
>   
>
> 
> 
>   Upload 
> brand image
>type=file name=file size=30>
> 
> 
> 
>   Choose 
> category
>   
>onChange="populateCountry(document.globe,document.globe.category.options[
> document.globe.category.selectedIndex].value)">
> Select Category
>   Computers
> Jewelry
>
> 
> 
> 
> 
>color="#F0">Sub-category
>   
>   
> 
> 
> 
>
>  
>   
>   
> 
>onClick="validate()">
> 
>   session_register("y");
> include("footer.inc");
> ?>
>
> 
>
> 
>
>
>
>> Date: Wed, 26 Sep 2001 08:22:04 -0500
>> Dan Brunner <[EMAIL PROTECTED]> [EMAIL PROTECTED] Re: [PHP-DB] i 
>> know i caused u a headache:)
>> Yep
>>
>> He is right...
>>
>>
>> Use php to do the variable
>>
>>
>>
>>
>> Dan
>>
>>
>> O

Re: [PHP-DB] i know i caused u a headache:)

2001-09-26 Thread Dan Brunner

Yep

He is right...


Use php to do the variable




Dan


On Wednesday, September 26, 2001, at 08:05 AM, Dave Watkinson wrote:

> you need to do ?brand=
>
>
>
> -Original Message-
> From: its me [mailto:[EMAIL PROTECTED]]
> Sent: 26 September 2001 14:11
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] i know i caused u a headache:)
>
>
> here is my situation:
>
> i select a category on store.php(from a form)
> then in the same page i have a javascript that tells:
>
>  x=document.forms[0].subcategory.selectedIndex
> y= document.forms[0].subcategory.options[x].text
>  if(y=="Printers" )
>  {
> windowopen("store1.php","newWindow")
>  return
>  }
>
> so i'll open a .php page i already have and according to the category
> that is selected a different page will be opened..ok?
>
> what i need is to have the value of the field category in the stor1.php
> page
>
> i tried to do it withsession(its the only point i got from u:))
> but how ???
> the variable y is what i wanna register...but its within javascript..i
> couldn't write like this:
>
> session_register("y")
> soi hope u got me
>
>
>
> i tried:
>
> open("store1.php?brand='y'","newWindow")
>
> but then brand =y
>
>
>
> 
> 
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Require() and Performance hit...

2001-09-25 Thread Dan Brunner

Hello!!

A simple question...

Has anybody had a performance hit, when using multiple Require() and 
Include() functions??



Just askingI use them all the timeBut want to simplify the code.



Tanks!!


Dan


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Backups, best practices

2001-09-06 Thread Dan Brunner

Hey Hey Hey!!!

That depends on what system your running!?!?!?

I run LinuxPPC and use 3 ways

1. Bru Tape back system

2. At 12:00 AM the shell script runs and copies the files..

3. Once a month I manually copy the files to a zip.


Dan



PS WindowsGood luck.


On Thursday, September 6, 2001, at 09:22 AM, Jacob Singh wrote:

> Hello,
>
>   I'm just wondering how everyone manages their MySQL backups, I'm
>   looking for a better solution than manual.  any scripts or example
>   would be especially appreciated. tnks
>
> --
> Best regards,
>  Jacob Singh
>  Pajama Design
>  (413)582-9342
>  2 Belanger Pl.
>  Northampton, MA 01060
>
> mailto:[EMAIL PROTECTED]
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Fw: [PHP-DB] PHP redirect?

2001-08-01 Thread Dan Brunner


OPPS WRONG SENDER HAHAHAHAHA!

I'm a little absent minded




Hello!!!


Here try this

if ($DATABASE===Custom)
{
$table=Table1;
}
if ($DATABASE===Return_Log)
{
$table=table=3;
$DATABASE=Return_Log;
echo ("");
echo ("");
echo (" $us On Linux Using Apache");
echo (""); 
echo ("Please wait while loading RA Database\n");
echo ("");
exit();
}

As you can see your using a IF...Statement

I too have this coming from a form.This simple code decides which Database is 
selected along with the TableThat way I can use the display code and everything 
else for other DatabasesPlus you can use this with usernames and passwordsSO 
what if the user can see his or her password

why I have exit ();...I don't remember why!?!?!?! AHAHAHAHAHAHHAit works fine for 
me

Also you can pass variables to the sending pagewith 
index.php?WHATEVER=$WHATEVER...on the redirectIt doesn't take long at all But I 
like to tell the user where the hell there going.

Since the form has passed the Variables over to the next page( or the page after the 
form)...these variable will be here to move on to the next page...But you must use 
them...or they are lost.



Dan

[EMAIL PROTECTED]

MYSQL ADMIN


"Webmaster" <[EMAIL PROTECTED]> wrote in message 
news:<[EMAIL PROTECTED]>...
> I have a form and based off of this form if my user selects option a then I
> want them to be redirected to another page. If they select option B then I
> want to continue with my php scrips as it does now.
> 
> Does any one have any ideas on how I can accomplish this?
> 
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP-DB] mssql_fetch_array problem

2001-06-19 Thread Dan Brunner

Hello!!!

Try using the second argument of mysql _fetch_array
MYSQL_NUM

This will insure that an integer is used..



If not let me knowI'll do testing...


Dan Brunner






On Monday, June 18, 2001, at 11:18 PM, Jennifer Arcino Demeterio wrote:

> hello all,
>
> hope someone could help me 
>
> it seems that the mssql_fetch_array did not work as it should when the 
> data
> type to be fetch is an integer ... is there any work around for this?
>
> Below is my script ...
>
> $country_sql = "select countryname, countryid from TBL_COUNTRY";
> if ($country_query = mssql_query($country_sql)) {
>while ($myrow = mssql_fetch_array($country_query))
>   if ($country == $myrow["countryid"]) {
>print " selected>" .
> $countryid . "";
>  } else {
>print "" .
> $countryid . "";
>  }
>   }
> }
>
>
> Thanks!
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]