RE: [PHP-DB] wildcard in mysql search with php

2001-10-18 Thread Dave Watkinson

select  from  where  like
'%searchword%'


RTFM!!!



-Original Message-
From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 14:58
To: [EMAIL PROTECTED]
Subject: [PHP-DB] wildcard in mysql search with php


Hello all,

Is there a way to use wildcards in search in a mySQL db?
e.g. I have a dbase of over 24000 records and i can only search exact
matches is there a way to search something like this : *admin* in mySQL?
Or
i have to do it by hand in PHP?

Thanks
Sir Thomas "omega" Henning



-- 
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] date

2001-10-18 Thread Dave Watkinson

mysql date format is -MM-DD including the hyphens)

I usually use substr() to convert it from a user's entry to the format
reqd for the database

hth

Dave


-Original Message-
From: ax [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 10:47
To: [EMAIL PROTECTED]
Subject: [PHP-DB] date


if i unput the values 10/10/2001 into mysql database, would mysql or php
recognize that as a date??

i am a bit confused. i inserted few dates in the above format and asked
mysql to list them by date and it does not seem to work.

any suggestions?? please :)

ax





-- 
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] Check Boxes/UPDATE

2001-10-02 Thread Dave Watkinson

Hiya Matt

you have to set the value of the checkbox to 1, and give it a unique
name.

if the user has checked the box when they submit the form then the
checkbox' name will have a value of 1. if they didn't check it it won't
have a value at all.


Hope this helps!


Dave


-Original Message-
From: Matt C [mailto:[EMAIL PROTECTED]]
Sent: 03 October 2001 03:23
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Check Boxes/UPDATE


I have a page of jobs with AuthStatus set to 0. Basically I want to list

each job title with a checkbox next to it. This I have done.

What I really don't understand is how do I make it so that the rows in
my 
table for all the different records when ticked are updated to 1?

Please help.

Matt

_
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp


-- 
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] Script

2001-09-30 Thread Dave Watkinson

Alternatively if you're using Windows you can write a batch file and use
AT to set it to run as often as you like.

Just include the path to PHP.exe and the path to the PHP file in the
batch file, like this...

D:\PHP\PHP.exe D:\Scripts\email_sender.php


HTH!


Dave


-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
Sent: 30 September 2001 04:53
To: PHP-DB List
Subject: Re: [PHP-DB] Script


Hector Gonzalez wrote:

> Hi, is there anyway to execute an script with no client intervension?,
for example,, i want to make a mailist, with a database,, it'll chek for
mail in an address and send email to the ones the are in the database,,
is there anyway to do this automatically?

Um, why?  There are programs specifically designed to do mailing
lists for you.  Mailman is one of those.
(http://www.gnu.org/software/mailman/mailman.html)

--
H | "Life is the art of drawing without an eraser." - John Gardner
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



-- 
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] (poss OT) mail() function

2001-09-27 Thread Dave Watkinson

hi all

We have a web based employment site, running on PHP and MySQL (to all
those didn't know!). Whenever a candidate sees a job they're interested
in they click a button and an email is sent to our consultants for them
to act on.

The problem, little as it is, is that I've written a function to send
the email (copied below) and sometimes (more often than not) the email
is fine (I get a copy), but other times it's all plain text and the
formatting isn't there.

Does anyone know why this would happen?

Cheers in advance


Dave



//  start copy of function

function send_email($whoto,$whofrom,$subject,$message) {
$subject = "[AUTOMATED NOTIFICATION] - $subject";
$mailheaders = "Content-Type: text/html;
charset=iso-8859-1"; // Mime type
mail($whoto, $subject, $message, $mailheaders);
 }

//  end copy of function

--
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] mysql_fetch_array() doesn't work

2001-09-26 Thread Dave Watkinson

that's not a mysql_fetch_array() error it's a coding error

-Original Message-
From: Web user [mailto:[EMAIL PROTECTED]]
Sent: 27 September 2001 05:48
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql_fetch_array() doesn't work


System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]"

What's the problem wiht mysql_fetch_array() or other?
What does the T_STRING' or `T_VARIABLE' or `T_NUM_STRING' mean?

THANKS
Mike


The full code below:


-

User
Added timeStatus";
$num=mysql_num_rows($res);
for($i=0; $i<$num; $i++) {
$arr=mysql_fetch_array($res);   /* HERE is line where the error
occurs!!!
*/
echo "
$arr['user_name']>";
echo "$arr['time']";
echo "$arr['status']";
echo "$arr['comment']";
}

echo "";

echo "";  /* show others in multi-pages */
for($i=0; $i<$pages; $i++){
echo "
echo ($i+1)."";
echo "  ";
}
echo "";

?>



-
create table users (
user_id int not null auto_increment primary key,
user_name varchar(30),
time datetime,
status tinyint(1),
comment text,
sign tinyint(1) default '1'
);






-- 
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 Dave Watkinson

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]




RE: [PHP-DB] sessions in PHP

2001-09-24 Thread Dave Watkinson

http://www.php.net/session



-Original Message-
From: nirat [mailto:[EMAIL PROTECTED]]
Sent: 25 September 2001 06:46
To: [EMAIL PROTECTED]
Subject: [PHP-DB] sessions in PHP


can anyone guide me to using sessions in PHP i've tried it a lot of
times
but its not working. any help tutorials would be helpful...


--
Nirat




-- 
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] Re: php and WAP?

2001-09-19 Thread Dave Watkinson

Yeah I also fail to see the php-db on-topic-ness of the original post,
but nevertheless, it's early in the morning, here's my tuppence worth...

All you need to do is configure Apache to make PHP process all .wml
files, and then change the header at the top of all your WML files to

header("Content-type: text/vnd.wap.wml");


Looky here

http://www.phpbuilder.com/columns/mike20010118.php3

Cheers


Dave




-Original Message-
From: Nael Mohammad [mailto:[EMAIL PROTECTED]]
Sent: 20 September 2001 00:32
To: 'Andreas D. Landmark'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: php and WAP?


And you can also use http://xml.apache.org/cocoon2/index.html which you
can
program to transcode anything to anything you want or you can just get
yourself a transcoder from www.aethersystems.com which uses Scout Web or
Clearigo www.clearigo.com  and then you have www.wap-shareware.com  and
use
this with your web server 

http://www.wap-shareware.com/directory/miscellaneous/waptool.shtml






-Original Message-
From: Andreas D. Landmark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 4:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: php and WAP?


At 20.09.2001 04:26, Andrius Jakutis wrote:
>Hello again,
>
>the problem Is that I found out, that my company doesn't support wml
files
>at all.
>
>What Do I have solution? USe some gateway, translator what ever else?
>
>What I need is : person takes mobile, enter's some URL, and my web site
is
>converted to wap language, so he can see everything, what is written
with
>PHP
>
>Thanks

php-db ?! I can't even figure out what the link is...

but to answer your question, as long as your page is mostly text (images

and wap
doesn't really click) it's the end-user and not the developer who has to

bother
with it.

Most WAP-serviceproviders provide their clients with http-gateways, and
if
not
there are some free ones aswell that proxy user-requests and translate
the
http content to wml on the fly.


-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
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]




RE: [PHP-DB] Help Please! Complex AND OR LIKE queries MySQL/PHP

2001-09-18 Thread Dave Watkinson

Cheers Rick ... I think I nailed it. I've copied my little function
below for anyone else interested.

Am keen on the "saving milliseconds" bit, though (will add it to the
function below before making it live). Any more tips?


Dave

function parse($what) {

$what = strtolower($what);
$what = ltrim($what);
$what = rtrim($what);

$wa = explode(" ",$what);
for ($i=0; $i<= sizeof($wa); $i++) {
if (strlen($wa[$i]) !==0) {
$j = $i + 1;
if ($wa[$i] == "or") {
$output .= " OR search_column
LIKE '%$wa[$j]%' ";
$i++;
} elseif ($wa[$i] == "and") {
$output .= " AND search_column
LIKE '%$wa[$j]%' ";
$i++;
} elseif ($wa[$i] == "not") {
$output .= " AND search_column
NOT LIKE '%$wa[$j]%' ";
$i++;
} else {
$output .= " AND search_column
LIKE '%$wa[$i]%' ";
}
}
}
//  strip leading AND from every option
$output = substr($output, 4, strlen($output)-3);
$what = $output;
return $what;
}


--
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] Help Please! Complex AND OR LIKE queries MySQL/PHP

2001-09-18 Thread Dave Watkinson

Hi everyone
 
I need to write a small search script for our admin site (and eventually
for the "outsiders" too!). There's a text box where the user types in
what they're searching for. It's easy enough to parse their string into
an array and create the query from it, for example
 

 
$s_a = explode(" ", $user_input);
for ($s_a_i=0; $s_a_i<= sizeof($s_a); $s_a_i++) {
$sql_text .= " column1 LIKE '%$s_a[$s_a_i]%' OR column2 LIKE
'%$s_a[$S_a_i]%' AND ";
}
 
and then tidy it up by adding
 
//remove trailing AND
$sql_text = substr($sql_text, 0, strlen($sql_text)-4);
 
//prepend start of sql command
$sql_text = "SELECT id, columnx, columny FROM sometable WHERE " .
$sql_text;
 
and then running the query.
 
However, what I need to be able to do is detect if people have typed in
the words AND OR or NOT and handle them appropriately, also remembering
that I'll be searching TWO columns in the table every time.
 
Are there perhaps any functions I can get for this? Or is there a really
easy way I can do it that's escaped (scuse the pun!) me?
 
Many thanks in advance
 
 
Dave
 



RE: [PHP-DB] Warning: Page has Expired

2001-09-03 Thread Dave Watkinson

look in php.ini (or whatever the Linux equivalent is) for
session.cache_limiter and set it to session.cache_limiter = nocache

HTH 8^D

Dave


-Original Message-
From: olinux o [mailto:[EMAIL PROTECTED]]
Sent: 03 September 2001 19:34
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Warning: Page has Expired


I have the same troubles. I believe that the only
solution is to use GET rather than POST as your FORM
METHOD. There may be another way, but this may work
fine, as long as you are not working with
passwords/sensitive info.

olinux


--- Mad Nas <[EMAIL PROTECTED]> wrote:
> Hi All
> 
> I'm using PHP 4 and MySQL in W2K .
> 
> When i submit a form and call a php file, i get this
> message :
> 
> __
> 
> Warning: Page has Expired


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
http://im.yahoo.com

-- 
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] Weird Problem In mysql_connect();

2001-08-31 Thread Dave Watkinson


err... neither!

Originally I had

function dbConnect (){
$link =
mysql_connect("ipaddress","username","password");
}

And what I tried to do was

require('somefile');
who's contents were:


and then edit the function on the first file to show

function dbConnect (){
$link = mysql_connect($host,$user,$pass);
}

When I saw that this wasn't working, I tried to put the three variable
at the top of the file and it still wouldn't work. I think Dan's on the
case with the IP Address thing ... I'll see what I can do about users
and stuff. I'm running Win2K here :-(


Cheers


Dave



-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 21:55
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Weird Problem In mysql_connect();


You mean you had all this inside a function? Like:
function dbConnect ()
{
$link = mysql_connect($host,$user,$pass);
}

?

If so, did you pass $host, $user, and $pass to the function by
global-ing
them like:

function dbConnect ()
{
global $host;
global $user;
global $pass;
$link = mysql_connect($host,$user,$pass);
}

-OR-

function dbConnect ($host,$user,$pass)
{
$link = mysql_connect($host,$user,$pass);
}

- Jonathan

"Dave Watkinson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
yeah - everything's fine! All the variables are being stored, but
they're not getting passed to mysql_connect() for some really strange
reason!

:-(

I've done a temporary fix - moved the entire database connection
function to a separate file, and required that from the first required
file (!), and it's working, but the original problem has still got me
confused!!!


Dave


-Original Message-
From: Brunner, Daniel [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 21:32
To: Dave Watkinson
Subject: RE: [PHP-DB] Weird Problem In mysql_connect();


Hello!!

Have your tried to echo the $host??

like

$host=123.100.321.1

echo $host;



Dan



> --
> From: Dave Watkinson
> Sent: Friday, August 31, 2001 3:17 PM
> To: PHP-DB List (E-mail)
> Subject: [PHP-DB] Weird Problem In mysql_connect();
>
> Hey all
>
> I can connect with $conn =
> mysql_connect("IP_Address","username","password");
>
> but I can't connect with
> $host = "IP_Address";
> $user = "username";
> $pass = "password";
>
> $conn = mysql_connect($host,$user,$pass);
>
> Any ideas? All I get is "Can't connect to MySQL Server on 'localhost',
> which is kinda weird cos I'm actually specifying a (different) IP
> address in the host argument.
>
> I know it wasn't broken, but I decided to try and fix it anyways!!!
>
> TIA!
>
>
> Dave
>
>
>



-- 
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] Weird Problem In mysql_connect();

2001-08-31 Thread Dave Watkinson

yeah - everything's fine! All the variables are being stored, but
they're not getting passed to mysql_connect() for some really strange
reason!

:-(

I've done a temporary fix - moved the entire database connection
function to a separate file, and required that from the first required
file (!), and it's working, but the original problem has still got me
confused!!!


Dave


-Original Message-
From: Brunner, Daniel [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 21:32
To: Dave Watkinson
Subject: RE: [PHP-DB] Weird Problem In mysql_connect();


Hello!!

Have your tried to echo the $host??

like 

$host=123.100.321.1

echo $host;



Dan



> --
> From: Dave Watkinson
> Sent: Friday, August 31, 2001 3:17 PM
> To:   PHP-DB List (E-mail)
> Subject:  [PHP-DB] Weird Problem In mysql_connect();
> 
> Hey all
>  
> I can connect with $conn =
> mysql_connect("IP_Address","username","password");
>  
> but I can't connect with
> $host = "IP_Address";
> $user = "username";
> $pass = "password";
>  
> $conn = mysql_connect($host,$user,$pass);
>  
> Any ideas? All I get is "Can't connect to MySQL Server on 'localhost',
> which is kinda weird cos I'm actually specifying a (different) IP
> address in the host argument.
>  
> I know it wasn't broken, but I decided to try and fix it anyways!!!
>  
> TIA!
>  
>  
> Dave
>  
> 
> 

--
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] Weird Problem In mysql_connect();

2001-08-31 Thread Dave Watkinson

Hey all
 
I can connect with $conn =
mysql_connect("IP_Address","username","password");
 
but I can't connect with
$host = "IP_Address";
$user = "username";
$pass = "password";
 
$conn = mysql_connect($host,$user,$pass);
 
Any ideas? All I get is "Can't connect to MySQL Server on 'localhost',
which is kinda weird cos I'm actually specifying a (different) IP
address in the host argument.
 
I know it wasn't broken, but I decided to try and fix it anyways!!!
 
TIA!
 
 
Dave
 



RE: [PHP-DB] PHP / MySql / catalogs / carts

2001-08-31 Thread Dave Watkinson

php.net has loads of such links - don't be so lazy! ;-)

-Original Message-
From: Larry "RedCobra" Linthicum [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 20:57
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP / MySql / catalogs / carts


I bet there are some shopping carts and or "catalogs"  using PHP and
MySql
out there that I can use for my project rather than start from scratch

links please

thanks in advance



-- 
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] Simple database error (SPACE)

2001-08-30 Thread Dave Watkinson

OK, try this


$db = mysql_connect("localhost", "","pass");

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads'
ORDER by first LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
$link_string = urlencode($myrow[3]);
echo "$myrow[3]";
}

and you shouldn't really be doing a SELECT * - just name the columns you
really need :-)




-Original Message-
From: Nagasea [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 01:01
To: Brunner, Daniel; '[EMAIL PROTECTED]'
Cc: PHP List (E-mail)
Subject: RE: [PHP-DB] Simple database error (SPACE)


it's still not working :(

maybe u need my script to see

$db = mysql_connect("localhost", "","pass");

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads'
ORDER by first LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
echo("
. $myrow[3] ."");

}

I need to make $myrow give the result exactly from the database
(including the space)

--- "Brunner, Daniel" <[EMAIL PROTECTED]>
> wrote:
>Hello!!!
>
>
>Use mysql_fetch_object...
>
>
>$myrow->WHATEVER
>
>
>Whatever = whatever the field name is
>
>
>
>Dan
>
>
>
>
>
>
>
>
>
>> --
>> From:Nagasea
>> Reply To:[EMAIL PROTECTED]
>> Sent:Thursday, August 30, 2001 5:01 PM
>> To:  [EMAIL PROTECTED]
>> Subject: [PHP-DB] Simple database error (SPACE)
>> 
>> //-- Anybody can help me with this problem (I think
>> //-- it's simple but im to stupid to know the answer)
>> 
>> ==
>> while ($myrow = mysql_fetch_row($result)) {
>> echo("
>> $myrow[3] ."");
>> }
>> ==
>> 
>> If I have a database in $myrow[3] and it has "space", it didn't work.
>> 
>> Example Database :  John Doe
>> __
>> 
>> it will shown 
>>  m_template?nick=John
>> 
>> I NEED PHP to show the space and Doe also
>> so it's suppose to be :
>> 
>>  m_template?nick=John Doe
>> 
>> 
>> 
>> _
>> www.kaskus.com - FREE EMAIL SERVICE
>> 
>> -- 
>> 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]
>> 
>>

_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Dave Watkinson

try urlencode in the PHP manual ... I believe that'll do the trick!

Cheers

Dave


-Original Message-
From: Nagasea [mailto:[EMAIL PROTECTED]]
Sent: 30 August 2001 23:02
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Simple database error (SPACE)


//-- Anybody can help me with this problem (I think
//-- it's simple but im to stupid to know the answer)

==
while ($myrow = mysql_fetch_row($result)) {
echo("
$myrow[3] ."");
}
==

If I have a database in $myrow[3] and it has "space", it didn't work.

Example Database :  John Doe
__

it will shown 
 m_template?nick=John

I NEED PHP to show the space and Doe also
so it's suppose to be :

 m_template?nick=John Doe



_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Re: Database "Transactions" and HTTP statelessness

2001-08-29 Thread Dave Watkinson

maybe you could add a column called lasteditdate to the table? Set it as
a DATETIME type and then check that the last edited date/time is not
within that last, say, 10 minutes? If it is compare the data?

Or add a TINYINT column to the table with a default value of 0, and when
a user chooses to edit the row, set the value to 1. If someone chooses
to edit a row and the value is 1 tell them it's locked elsewhere (maybe
even tell them who's got it). Then when they update their changes reset
the 1 to a 0.

Just a coupla ideas :-)


Dave


-Original Message-
From: Bopolissimus Platypus [mailto:[EMAIL PROTECTED]]
Sent: 29 August 2001 13:10
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Database "Transactions" and HTTP statelessness


On Tue, 28 Aug 2001 23:55:32 -0300, [EMAIL PROTECTED] (Manuel Lemos)
wrote:
>The solution is to pass data between pages and only commit it when you
>are done with all the data that you need to grab from the user.
>Transactions can't be kept between HTTP requests, but you can pass data
>between pages so you keep the choices of the user that reaches to the
>end of your process.

that's not really addressing my concern.  i'm not worried about the
coding details of multiple forms and such.  i'm concerned about
data consistency.

in case i wasn't clear enough in the original post:

let's say each row has an identifying serial number, id:

User A loads and edits the row with id=1.  row is not yet saved. 
 lastname and state fields modified but only in the browser
 for now, not yet POSTed to the server.  state is set to SC.
 lastname is, ah, "Lemos".

User B loads and edits the row with id=1.  row is not yet saved.
 state field is set to NC.  no other fields edited.

User B SAVES his edits.  on disk, the row iwth id=1 now has state
 set to NC.

User A SAVES his edits.  on disk, the row with id=1 has the
 changed lastname (maybe a problem, but probably not),
 and state is set to SC.

the lack of row locking has made B's change of the state
disappear.  and it might be that B's change is the correct one.
so now A has the wrong state data.

ideally, if B tries to save his edits, the system would tell him
that A (or someone, possibly unspecified) has the lock on
the row and the edit cannot be saved.  B can then decide
what to do (wait before trying to save again?  reload the
data so that he gets latest data?  before loading the
record, try to get a select for update, so that the select
won't even return until the row is available for editing
and B OWNS the lock (the select won't return until
the lock is available, or it may return but with error so 
that B knows that he doesn't have the lock).

an ugly alternative i've considered is keeping the
original (unedited) data in session variables and BEFORE
WRITING THE EDITED DATA, first get a select for
update (which locks the row), check if the data has 
changed, and only if it hasn't, do the write.  if the 
data is not the same as the original unedited 
data, then someone else has modified the data 
and we reload the record and allow edits by 
the user before trying to write again (possibly
with some smart features to minimize retyping of
edits).

there are also non-transaction based hacks one of 
which would involve having a lock file that stores 
locks owned by particular logical "sessions".  
all database access would then first check to see 
if there is a lock record for the particular row 
being requested.  if it's locked, then the row 
can still be viewed, but it would be read-only.  
if a 'session' owns the lock, then the row 
would be editable (there would be a "Submit" 
or "Update Database" button, which would 
not be there ifthe row is read-only because 
some other session owns the lock).  there 
would then be some sort of regular lock 
clearing program which would clear out locks 
which had timed out.

>You may want to take a look at this multi-page forms that may help you
>to keep data between forms that can be walked back and forth.

thanks for the reply, but that's not the problem i'm worried
about :).

tiger

-- 
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] query question

2001-08-28 Thread Dave Watkinson

instead of SELECT all_records WHERE some_condition, and then DELETE
certain_rows, couldn't you just do a DELETE FROM WHERE?


-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question


Hi,

If I run a query;-

$result = mysql_query($query);

is there a way of deleting rows from $result after this runs.  Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.

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]




RE: [PHP-DB] how can save image in mysql

2001-08-16 Thread Dave Watkinson

I have a personal dislike to storing binary data in a database. What I
do is upload the file to a specific place on the server and then insert
a link into the database as the URL to the file.

There's loads of places you can find upload examples - try
www.thickbook.com or www.phpbuilder.net

HTH :-)


Dave


-Original Message-
From: Mad Nas [mailto:[EMAIL PROTECTED]]
Sent: 16 August 2001 10:11
To: [EMAIL PROTECTED]
Subject: [PHP-DB] how can save image in mysql


Hi all
How can save a image in a field of mysql table with use php language ?

thanks for answer
Mad Nas



-- 
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] quick http question

2001-08-15 Thread Dave Watkinson

do you mean

http://www.some_server.com/some_page.php?login=mylogin&password=my
password">click me

???

or did I misunderstand the question?

-Original Message-
From: Brian Weisenthal [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2001 20:54
To: [EMAIL PROTECTED]
Subject: [PHP-DB] quick http question


i need a script to access a html file on the web. i need to pass a login
and
password to the server. i tried doing
http:[EMAIL PROTECTED]:[EMAIL PROTECTED]  , it didnt work,
anyone
have an idea how to do 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]


--
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] Another SELECTING problem :-(

2001-08-09 Thread Dave Watkinson

thanks for that ... I've made some comments within yours...

 

Your getting a lot of errors, because the statement has well a lot of
mistakes. Let's start near the beginning, you state:



SELECT  empid, COUNT(empid)  FROM emp_cont , employers, contacts



This statement should produce an error, since you didn't tell the
database which table to take empid from.  A working statement would look
like
[Dave Watkinson] 
yeah, but empid inly exists in one of the tables in the FROM argument,
so there's no error there 



SELECT  empid, COUNT(empid)  FROM emp_cont   or

SELECT  emp_cont.empid, COUNT( emp_cont.empid)  FROM emp_cont ,
employers, contacts



The next major error is to use a Count function without the group by.
I'm not an SQL guru, but I believe whenever you use count you must also
use group by or having so adding a



SELECT  empid, COUNT(empid)  FROM emp_cont GROUP BY empid
[Dave Watkinson] 
yep - that works :-) 



will correct that.


Unfortunately, I think the larger issue is how your trying to find your
query.  Your query did confuse me a little, so I could be wrong, but
technically speaking, if you are trying to locate an employee with more
than one record in employee contracts, then there's no need to involve
the contracts table within the query.
[Dave Watkinson] 
no - it's employers with more than one contact, hence the names of those
tables in the WHERE bit :-)


So say I have table Employees that contains empid, name, ssn.  Then I
have table Employee Contracts that contains, empid, contractid.
Assuming that all empid(s) on Employee Contracts have a correlating
empid in Employees (which they will if the table was defined properly)
then the steps to get what you want are:


Step 1:  Return a Count of empid



SELECT COUNT(empid) AS countid FROM emp_cont GROUP BY empid



Step 2: Return employees with more than one contract


SELECT empid FROM emp_cont WHERE countid >1


[Dave Watkinson] 
makes sense 


You'll note that both step requires a return, which general means a
subquery, I believe for MySQL to hanle subqueries you actually have to
perform to separate queries. If your not  using MySQL then you could
write a statement such as:



SELECT empid FROM emp_cont WHERE (SELECT COUNT(empid) FROM emp_cont
GROUP BY empid) [note statement may need tweaking since I use MySQL and
can't test it]



that didn't work
 


If your using MySQL, I believe you need to return the results from one,
then use the results to find the next. Or you could use PHP to cheat,
and return all results, but only display the ones where the count is
greater than 1.


A subquery is best if your tables are large, returning 1000 results to
display 50 wastes time. But if you have under 200 employees, then just
use the SQL statement
[Dave Watkinson] 
I *am* using MySQL, but found another way round it - Steve got it right
away - I wanted a one-to-many, not a many-to-many, so I just added an
employer_id column to the contacts table.
 
D'oh!
 
Thanks anyway .. I'm getting used to GROUP now :-)
 
 
Cheers
 
 
Dave
 



Alnisa

-- 
  .
   Alnisa  Allgood
   Executive Director
   Nonprofit Tech
   (ph) 415.337.7412  (fx) 415.337.7927
   (url)  http://www.nonprofit-techworld.org
   (url)  http://www.nonprofit-tech.org
   (url)  http://www.tech-library.org
  .
   Nonprofit Tech E-Update
   mailto:[EMAIL PROTECTED]
  .
   applying technology to transform
  .




RE: [PHP-DB] Another SELECTING problem :-(

2001-08-09 Thread Dave Watkinson

PS This is for a web page, so it's PHP related!!! :-)

-Original Message-
From: Dave Watkinson 
Sent: 09 August 2001 12:51
To: PHP-DB List (E-mail)
Subject: [PHP-DB] Another SELECTING problem :-(


I've a feeling I've asked this before, but checked my old messages and
couldn't see it in there for the excess of non PHP-Database questions
flying around (yep - that's a joke, but I've been here a while - forgive
me!).
 
I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship. What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.
 
I've tried this...
 
select 
empid, count(empid) 
from 
emp_cont , employers, contacts
where
emp_cont.empid = employers.uid
and
emp_cont.contid = contacts.uid
and
count(empid) > 1;
 
and get all kinds of invalid grouping messages
 
many TIA
 
 
Dave
 

--
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] Another SELECTING problem :-(

2001-08-09 Thread Dave Watkinson

I've a feeling I've asked this before, but checked my old messages and
couldn't see it in there for the excess of non PHP-Database questions
flying around (yep - that's a joke, but I've been here a while - forgive
me!).
 
I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship. What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.
 
I've tried this...
 
select 
empid, count(empid) 
from 
emp_cont , employers, contacts
where
emp_cont.empid = employers.uid
and
emp_cont.contid = contacts.uid
and
count(empid) > 1;
 
and get all kinds of invalid grouping messages
 
many TIA
 
 
Dave
 



RE: [PHP-DB] blinking background

2001-08-09 Thread Dave Watkinson

I guess it's either a timer thing, and change the mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 11:24
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] blinking background


i just want to catch the attention of the user and the blinking effect
of
the table row is not forever, it will stop after a certain time. :)


- Original Message -
From: Russ Michell <[EMAIL PROTECTED]>
To: J- E- N <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, August 09, 2001 6:41 PM
Subject: Re: [PHP-DB] blinking background


> > is there anyone who can give me an idea on how i can write a php
script
> > that can make my table row background blinking.
>
> Why on earth would you want to do that?? It would fully distract
anyone
> looking at the information within the table - which I *presume* is why
> you want information in the table right? For people to look at and
> assimilate!?
>
> I'm aware of the concept "A bad idea - but help out the person anyhow"
> but this one is just silly!
>
> Russ
>
> On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N <[EMAIL PROTECTED]> wrote:
>
> > hello!
> >
> > is there anyone who can give me an idea on how i can write a php
script
> > that can make my table row background blinking.
> >
> > 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]
> >
>
> #---#
>
>   "Believe nothing - consider everything"
>
>   Russ Michell
>   Anglia Polytechnic University Webteam
>
>   e: [EMAIL PROTECTED]
>   w: www.apu.ac.uk/webteam
>   t: +44 (0)1223 363271 x 2331
>
>   www.theruss.com
>
> #---#


-- 
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] order by date

2001-08-09 Thread Dave Watkinson

you can use order by date DESC 
for descending

or 

order by date
for ascending

nice to see a PHP-Database question in here ;-)


Dave


-Original Message-
From: Scott Chapman [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 10:50
To: [EMAIL PROTECTED]
Subject: [PHP-DB] order by date


Hi,

I am querying a mysql database and am returning data ordered by date,
the
trouble is it returns the data from least recent to most recent, I want
it
to return the data the other way round.  Is there a way of having the
mysql
database doping this re-ordering for me rather than coding it myself?

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]




RE: [PHP-DB] Error checking and escaping before running a query (MySQL)

2001-08-08 Thread Dave Watkinson

Wicked!

Thanks Beau - it's not quite there but it's better than errors and
timeouts all over the place!

I'll keep playing with it - thanks again!


Dave

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: 08 August 2001 08:28
To: Dave Watkinson; PHP-DB List (E-mail)
Subject: RE: [PHP-DB] Error checking and escaping before running a query
(MySQL)


Dave,
sounds like you are on the right track, but rather than use the
comparatively bulky regular expression engine, why not just the
light-weight
string function

str_replace( ",", " ", $searchbox );

(see "String Functions" in the manual)

and you should be able to do 

str_replace( "\"", " ", $searchbox );

without violating any holy regex laws :)

// -Original Message-
// From: Dave Watkinson [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 3:18 PM
// To: PHP-DB List (E-mail)
// Subject: [PHP-DB] Error checking and escaping before running a query
// (MySQL)
// 
// 
// Hi all
//  
// I have a searchbox that throws a wobbly when certain characters are
// entered into it - basically the user is supposed to enter a
// space-delimited list of words to search for, and then I 
// create an array
// from it and turn it into an OR etc query.
//  
// What I initially did was replace all commas with spaces, but I've
// realised that double-quotes mess it up too.
//  
// The command I used for the spaces is
//  
//  $searchbox = ereg_replace(" ," ," ", $searchbox);
//  
// I tried
//  
//  $searchbox = ereg_replace(" \"" ," ", $searchbox);
//  
// but the page shows an error of 
//  
// Warning: REG_EPAREN: in
// d:\apache\htdocs\dev\code\can_search_quick.php on line 22
//  
// there's a parse error if I don't escape the ", so what can I 
// do? I know
// how to do it in VB!
//  
// I searched PHP.net, but could only find an old bug report 
// that advised
// escaping special characters!
//  
// Help!
//  
//  
// Thanks in advance
//  
//  
// Dave
//  
// 

--
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] Error checking and escaping before running a query (MySQL)

2001-08-07 Thread Dave Watkinson

Hi all
 
I have a searchbox that throws a wobbly when certain characters are
entered into it - basically the user is supposed to enter a
space-delimited list of words to search for, and then I create an array
from it and turn it into an OR etc query.
 
What I initially did was replace all commas with spaces, but I've
realised that double-quotes mess it up too.
 
The command I used for the spaces is
 
 $searchbox = ereg_replace(" ," ," ", $searchbox);
 
I tried
 
 $searchbox = ereg_replace(" \"" ," ", $searchbox);
 
but the page shows an error of 
 
Warning: REG_EPAREN: in
d:\apache\htdocs\dev\code\can_search_quick.php on line 22
 
there's a parse error if I don't escape the ", so what can I do? I know
how to do it in VB!
 
I searched PHP.net, but could only find an old bug report that advised
escaping special characters!
 
Help!
 
 
Thanks in advance
 
 
Dave
 



RE: [PHP-DB] Transforming doc files into html

2001-08-04 Thread Dave Watkinson

Yeah you can - I've been doing this with Visual Basic. I've been
receiving people's Word Document CVs, and then converting them to text
for inserting to the database, and then converting to HTML for
prospective employers to view them online.

All you need to do is reference Microsoft Word in your project, and then
you can open a document and make it perform a "Save As HTML", add the
link to the database as a URL and you then have a clickable link to the
converted file. This is all done with a combination of Visual Basic, PHP
and MySQL.

Hope this helps you out :-)


Dave



-Original Message-
From: Cami [mailto:[EMAIL PROTECTED]]
Sent: 04 August 2001 12:08
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Transforming doc files into html


Hi there,
Does anybody know if is any way in which when you upload a word document
file you can parse it and transform
it into an html file?
Is this possible ? Has anybody tried it? I know I can transform it into
a
txt file but wouldn't it be even better if we can do an html file?

Thanks,
Cami


-- 
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] Trouble with PHP/MYSQL/APACHE

2001-08-02 Thread Dave Watkinson

looks like your include path and/or file don't exist. Double check that
colon before /usr - surely that's incorrect? The undefined function is
probably because the include file can't be found.


Dave


-Original Message-
From: Al Moote [mailto:[EMAIL PROTECTED]]
Sent: 02 August 2001 20:06
To: PHP Mailing List
Subject: [PHP-DB] Trouble with PHP/MYSQL/APACHE


I apologize in advance if my question seems tedious.

I am trying to use PHPNuke (http://www.phpnuke.com) but after I install
as per the instructions, I get an error when trying to access
http://mydomain.com/admin.php that reads:

***

Warning: Failed opening 'themes/NukeNews/theme.php' for inclusion
(include_path='.:/usr/share/php') in /var/www/html/header.php on line 42

Fatal error: Call to undefined function: themeheader() in
/var/www/html/header.php on line 53

***

This is a specialized issue, but I hope that other PHPNuke admins are
out there.

Regards,

Alan Moote
SysAdmin



-- 
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] PHP redirect?

2001-08-02 Thread Dave Watkinson

I've changed what I originally answered with, assuming option 1 has the
value 12 (as you describe) and option 2 has value 14...



then you can get that value with this...

(top of some_page_or_other.php)

$user_selected_value = getenv("QUERY_STRING");

(top of some_other_page_you_choose.php)


$user_selected_value = getenv("QUERY_STRING");



Cheers


Dave




-Original Message-
From: CrossWalkCentral.Net (Webmaster)
[mailto:[EMAIL PROTECTED]]
Sent: 03 August 2001 02:38
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PHP redirect?


I got it to work Thanks to Dave Watkinson however I do have another
question.

If I redirect to another page will I be able to pass the variable from
the
form to it as well?

here i my layout.

>From passes 6 variables to my php redirect if they sletect option 2 the
the
value is 12 redirecting to annother php file where i will need that
value of
12.



"Dave Watkinson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


that's all you need - make sure the form on the previous page has two
radiobuttons, each with the same name of option_button and each has a
value - one is 1 and the other is 2.


HTH :-)



Dave






-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]]
Sent: 02 August 2001 04:45
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP redirect?


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]




-- 
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] PHP redirect?

2001-08-01 Thread Dave Watkinson



that's all you need - make sure the form on the previous page has two
radiobuttons, each with the same name of option_button and each has a
value - one is 1 and the other is 2.


HTH :-)



Dave






-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]]
Sent: 02 August 2001 04:45
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP redirect?


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]


--
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] Limit Select Field Characters?

2001-08-01 Thread Dave Watkinson

$fulldate = date("dmy");
echo $fulldate;



-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 01 August 2001 23:34
To: PHP-DB
Subject: [PHP-DB] Limit Select Field Characters?


I have a timestamp field that looks like this
0109011754
but I only want to compare
010801
when doing a SELECT. Is there a way I can do this? Thanks.
Jeff Oien


-- 
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] UPDATE Not Updating

2001-08-01 Thread Dave Watkinson

Isn't PHP/MySQL case sensitive? Are all the column names the correct
case?

You could also try changing your die bit to

or die (mysql_error());

that will echo the MySQL error message.

HTH!


Dave


-Original Message-
From: Steve Fitzgerald [mailto:[EMAIL PROTECTED]]
Sent: 01 August 2001 22:25
To: [EMAIL PROTECTED]
Subject: [PHP-DB] UPDATE Not Updating


I belive this UPDATE should work, but it isn't. I get no errors. I have
also
tried using FieldName= '$Fieldname', but that does not seem to work
either.



$table_name = "contacts";


$update_contact_sql = "UPDATE $table_name
SET
FirstName =\"$FirstName\",
LastName = \"$LastName\",
Title = \"$Title\",
WorkPhone = \"$WorkPhone\",
HomePhone = \"$HomePhone\",
Mobile = \"$Mobile\",
EmailName = \"$EmailName\",
Birthday = \"$Birthday\"
WHERE ContactID = \"$ContactID\"
";


$result = @mysql_query($update_contact_sql, $connection) or die
("Couldn't
execute query.");



-- 
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] Finding NoMatches in MySQL

2001-07-30 Thread Dave Watkinson

Thanks everyone that was just the ticket :)

Off to read up on JOINs now...

Thanks again


Dave


-Original Message-
From: Dobromir Velev [mailto:[EMAIL PROTECTED]]
Sent: 30 July 2001 08:42
To: Dave Watkinson; PHP-MySQL List
Subject: Re: [PHP-DB] Finding NoMatches in MySQL

Hi,
I think this query should do the job

SELECT jobs.uid FROM jobs LEFT JOIN employers ON jobs.id1 = employers.uid
WHERE employers.uid is Null

Dobromir Velev


-Original Message-
From: Dave Watkinson <[EMAIL PROTECTED]>
To: PHP-MySQL List <[EMAIL PROTECTED]>
Date: Monday, July 30, 2001 12:56 AM
Subject: [PHP-DB] Finding NoMatches in MySQL


>Hi all
>
>During the process of importing a lot of Oracle data into MySQL, I have two
>tables that are giving me a bit of a headache. One is a list of jobs and
the
>other is a list of employers. There's now a unique id for each table, and
>the job table also has a column called id1, which *should* correspond to
>employers.uid.
>
>With me so far?
>
>Well, the problem is that there were loads of duplications in the employers
>table, and after deleting the duplicates some of the jobs.id1 records now
>point to non-existing records.
>
>How do I do a query that does something like this...
>
>select jobs.uid from jobs where jobs.id1 not in employers.uid
>
>???
>
>many thanks in advance!
>
>Dave
>
>
>
>--
>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] Finding NoMatches in MySQL

2001-07-29 Thread Dave Watkinson

Hi all

During the process of importing a lot of Oracle data into MySQL, I have two
tables that are giving me a bit of a headache. One is a list of jobs and the
other is a list of employers. There's now a unique id for each table, and
the job table also has a column called id1, which *should* correspond to
employers.uid.

With me so far?

Well, the problem is that there were loads of duplications in the employers
table, and after deleting the duplicates some of the jobs.id1 records now
point to non-existing records.

How do I do a query that does something like this...

select jobs.uid from jobs where jobs.id1 not in employers.uid

???

many thanks in advance!

Dave



-- 
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] replace string - case insensitive

2001-07-29 Thread Dave Watkinson

go to http://www.php.net/eregi_replace



hth


Dave



-Original Message-
From: J- E- N [mailto:[EMAIL PROTECTED]]
Sent: 28 July 2001 15:41
To: [EMAIL PROTECTED]
Subject: [PHP-DB] replace string - case insensitive


hello

str_replace is case sensitive, what function should i use for case
insensitive.

thanks very much.



-- 
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] Re: simple database question

2001-07-26 Thread Dave Watkinson


Oops sorry

I keep assuming this is a MySQL/PHP list! D'oh!



Dave



-Original Message-
From: Brian Weisenthal [mailto:[EMAIL PROTECTED]]
Sent: 26 July 2001 15:08
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: simple database question


oh, using ms sql

"Brian Weisenthal" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ok this should be an easy one, i am just blanking on it here.
>
> i want to link two tables together, a user table and address table. i
create
> the user entry first, then create the address entry. after creating the
> address entry how do i get the auto_id that was entered in to enter it
into
> the user table? there is no unique field in the address table. 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: [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] simple database question

2001-07-26 Thread Dave Watkinson

What I usually do is do a SELECT COUNT(user_primary_key_column_name) and
count the number of rows - then I'll know what the last autonumber added
was.

A more accurate way is to do your INSERT statement, then follow it
immediately with a SELECT

select uid,name,address1,phone from users where name = '$name', address1 =
'$address1', phone = '$phone'

or whatever

then you can retrieve the value of uid for your address INSERT.


hth

Dave
currently been here 16 hours...and counting
Zzz




-Original Message-
From: Brian Weisenthal [mailto:[EMAIL PROTECTED]]
Sent: 26 July 2001 14:53
To: [EMAIL PROTECTED]
Subject: [PHP-DB] simple database question


ok this should be an easy one, i am just blanking on it here.

i want to link two tables together, a user table and address table. i create
the user entry first, then create the address entry. after creating the
address entry how do i get the auto_id that was entered in to enter it into
the user table? there is no unique field in the address table. 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: [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] Retrieving Rows - Can I Change The Order?

2001-07-25 Thread Dave Watkinson

Hi all

I think this should be a nice easy one...

I get a select * query, then I start checking what values are in certain
columns for a given row. Usually I do something like

if ($row[3] == "1") {
//  do something
} else {
//  do something else
}

OK - nice and easy.

Now then, I have changed a column in the table, and the only way I found to
change a data type is to delete the offending column and then add it again.

When I do the select now the new column, which was at $row[3] is now always
$row[39]. I don't mind this, because I know where it is, but is there any
way I can make it appear at $row[3] again? I'm sure you can imagine when
there are quite a few pages using this code it's easier to reorder the
columns in the select than to change all my if() codes!

By the way, I know I can be explicit by SELECTing each column by name, but
I'ds rather use a SELECT * fror this partucular instance.

Any ideas? Or am I just being lazy (it's been a long night after all!)?


TIA


Dave






-- 
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] Re: another php/mysql problem

2001-07-25 Thread Dave Watkinson

Hi Matt

I think I get what you're trying to do.

I'd do something like this...

Put all three tables in the same database. Add a column to bands called uid
(I _think_ you'll have to recreate the table first cos you need it to be
AUTO_INCREMENT, and add a PRIMARY KEY onit). Then add a column to shows
called band_id and a column to releases called band_id.

Your query for bands.php will be something like this...

SELECT * FROM bands, shows, releases WHERE bands.uid = '$band' AND
shows.band_id = bands,uid AND releases.bandid = bands.uid

This will get you one long row full of everything to do with that band.

Displaying the material is just a matter of doing a while ($row =
mysql_fetch_row)) etc


Make sense?

HTH!

Dave


-Original Message-
From: Matt Nigh [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 18:15
To: Markus Wagner; [EMAIL PROTECTED]
Cc: php-db
Subject: Re: [PHP-DB] Re: another php/mysql problem


ok, well it looks like no one really understood my problem, which is ok
because didn't explain it well. i can barely understand myself what i'm
trying to do, but what i'll try doing is just telling you all what exactly i
need to happen.

ok, i have 3 tables, two of them (bands, shows) being in a DB named
almavale_board and the other table (releases) being in a DB named
almavale_releases. essentially what i want to have is a bands page that
displays a bio, links etc. (from the bands table), their releases (releases
table) and their shows (shows table). i need to pull this data from the two
DBs and then display them so each band has their own page, but it runs off
the same page (ie. bands.php). so what i want to have is
http://site.com/bands.php?band=thebandsname and then since i've defined the
variable $band in the URL, only the info from the row in the
'nospaces_bands' column with the value 'thebandsname' will be displayed.
then from that, the shows table will take the value from one of the columns
in the 'bands' table named 'band_bands' and will find all the records in the
shows table that have that same value in the column 'artistname'. then from
there, the releases table in the 'almavale_releases' DB will take the value
from the column 'artistname' in the 'shows' table and  will find all the
records in the releases table that have that same value in the column
'bandname'. so basically, i wanna pass multiple variables across these
tables/databases and display all the records that match each one. it's
pretty confusing, so i hope i explained it well enough for all to
understand.

thanks,


Matt


- Original Message -
From: "Markus Wagner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 25, 2001 5:25 AM
Subject: [PHP-DB] Re: another php/mysql problem


>
>
> Matt Nigh schrieb:
>
> > Matt Nigh
> >
> >  > $link = mysql_connect("localhost","username","password");
> > if(!$link) die ("Could not connect to MySQL!");
> > mysql_select_db("almavale_board",$link);
> > if (!isset($band)) {
> > die("No artist specified.");
> > }
> > $sql = "select * from bands where (nospaces_bands = '$band')";
> > $result = mysql_query($sql);
> > if (mysql_num_rows($result) <= 0) {
> > die("Sorry, there was no artist found by that name.");
> > }
> > if (!$my_row = mysql_fetch_array($result)) {
> > die("Please specify an artist.");
> > }
> > $band = "nospaces_bands";
> > $band_spaces = "band_bands";
> > $id = "id";
> > $email = "email";
> > echo "band name without spaces: " . $my_row["$band"];
> > echo "band name with spaces: " . $my_row["$band_spaces"];
> > echo "id: " . $my_row["$id"];
> > echo "email address: " . $my_row[$email];
> >
> > $band_spaces = $artist;
> >
> > mysql_select_db("almavale_board",$link);
> > $sql_01 = "select * from shows where (artistname = '$artist')";
> > $result_01 = mysql_query($sql_01);
> > if (mysql_num_rows($result_01) <= 0) {
> > die("No shows found.");
> > }
> > $my_row_01 = mysql_fetch_array($result_01);
> >
> > $artist = "artistname";
> > $venue = "venue";
> > $time = "time";
> > echo "artist name with spaces: " .
$my_row_01["$artist"];
> > echo "venue: " . $my_row_01["$venue"];
> > echo "time: " . $my_row_01["$time"];
> >
> > $artist = $band_name;
> >
> > mysql_select_db("almavale_releases",$link);
> > $sql_02 = "select * from releases where (bandname = '$band_name')";
> > $result_02 = mysql_query($sql_02);
> > if (mysql_num_rows($result_02) <= 0) {
> > die("No releases found.");
> > }
> > $my_row_02 = mysql_fetch_array($result);
> > $band_name = "bandname";
> > $albumtitle = "albumtitle";
> > $email = "email";
> > echo "artist name with spaces from releases: " .
$my_row_02["$artist"];
> > echo "album name: " . $my_row_02["$albumtitle"];
> > echo "album code: " . $my_row_02["$albumcode"];
> >
> > mysql_close($link);
> > ?>
>
> What do you exactly want to do?
>
> And what is that?
>
> $band = "nospaces_bands";
> $band_spaces = "band_bands";
> $id = "id";
> $email = "email";
>
> Why don't you do this:
>
> echo "band name without spaces: " . $my_row["band"];
> ech

RE: [PHP-DB] Now, I have new problem!!

2001-07-22 Thread Dave Watkinson

Hi Tony

Don't know if you got any feedback on this, but I would crate a form on the
HTML page with an input type (say a dropdown list) with the name of, for
example, itemnumber.

The code could be something like this...



Item description
Item description
Item description
etc



then in inventory.php you can retrieve the value of the variable $itemnumber
to see which item was selected.


Hope this helps!



Dave





-Original Message-
From: Tony [mailto:[EMAIL PROTECTED]]
Sent: 22 July 2001 03:13
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Now, I have new problem!!


My server has a cgi-local bin, where all of my cgi scripts have to be stored
in there.
When I input the script into my regular html pages, it doesn't work.
This is the script that I am using and saved as inventory.php,

Unable to locate the inventory " .
  "database at this time." );
  exit();}

  $itemx = "9846";
  $sql = "SELECT quantity FROM inventory WHERE item = '$itemx'";
  $result = mysql_query($sql,$link);
  $row = mysql_fetch_array($result);
  $num = $row["quantity"];

  if ($num < 1) {
  echo "Out of Stock";
  } else {
  echo "In Stock";
  }

  mysql_close($link);
?>

How can I connect from my html page with known value of $itemx = "" to
this scrip(inventory.php), and get result back on to my html page with words
"In Stock" or "Out of Stock"?
Can anybody help me please?
Thanks for your time again.
Tony



--
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]