RE: [PHP-DB] Simple field replace...?

2003-08-28 Thread Snijders, Mark
I guess there is no other solution

just do it one at a time... it's no problem even if there are 100's.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: donderdag 28 augustus 2003 11:35
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Simple field replace...?


Hi there,
I need to take a field in my database, and remove the first 32 characters 
from each entry...
There are 100's, and I know there's gotta be an easy way...
I've looked up string replace, and it only appears to work one at a 
time...
Can anyone tell me how to make it accross the whole table...?

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



[PHP-DB] [php] printing query output to a printen and or file

2003-07-14 Thread Snijders, Mark
hello

i'm busy with generating some overviews out of a mysql database (with php)

this are aroudn 8 different overviews and query's.

and the output to the screen is very nice.

but now i'm also want to give the visiter the option to send the output to a
printer of file.

but how do I manage that? and can you also add some options for the 'format'
to be different when printing or viewing it on the screen?


Kind regards,

mark



RE: [PHP-DB] Problem with select-tag within a php-script

2003-07-02 Thread Snijders, Mark
the select has to be a name and not the id

the id has to be within the option value!



-Original Message-
From: Ruprecht Helms [mailto:[EMAIL PROTECTED]
Sent: woensdag 2 juli 2003 15:51
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Problem with select-tag within a php-script


Hi,

I've some trouble with a select-tag in a php-script.
In a database should be written the ID of a table, the user could select
the recordset by the Name. My problem is that the fieldentry of the
selecttag is not transfered to the executionscript. The different Names
within the recordset are shown correctly.

Here my listing

?
mysql_connect(localhost,root);
$result=mysql_db_query(chorportal,SELECT * FROM choere ORDER BY
Name);
echo select value='chorid';
while($row = mysql_fetch_object($result))
{
echo option value=\'.$row-ID.\';
echo $row-Name;
echo /option;
}
echo /select;
?

Regards,
Ruprecht


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



RE: [PHP-DB] Re: PHP help

2003-06-30 Thread Snijders, Mark
think you miss something


try this : 

print_r($_POST);


cause from a specific php version (above 4) al lthe form vars are in a
special array called ($_POST)   (when submitted by a form)


so you should do:

query=INSERT INTO login VALUES ('$_POST[login]');

I also removed a   you got one to many


hope this works!


-mark-




-Original Message-
From: Shivanischal A [mailto:[EMAIL PROTECTED]
Sent: maandag 30 juni 2003 13:13
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: PHP help


 My System:
 Windows 98
 Apache 1.3.27
 PHP 4
 mysql

 Hello all, I am a PHP beginner and was wondering if I could get some help
from some of the more experienced on this list.  I have been trying to use
an html form (with textboxes, radio buttons, and textareas) to input data
into a mysql database.  I am able to connect fully with the database and am
able to create tables in it, but when I try to input information into the
tables nothing happens. ever...  I don't really know what to do from here,
but I assume that a configuration is not set properly between mysql, apache,
windows, or php.  I really don't know what it could be.  My code is here and
I have tried to simplify the form in order to get it working, so here is my
barebones code that hopefully has some errors:
 HTML:
 html
 head
 titleSimplify/title
 /head
 body
 form action=addform.php method=post
 Login: input type=text name=login
 input type=submit
 /form
 /body
 /html

 PHP file called addform.php:

 ?

 $user=chris;
 $database=test;
 mysql_connect(localhost,$user);


localhost should probably be  $localhost  OR'localhost'(?)


 @mysql_select_db($database) or die(unable to select database);
 $query=INSERT INTO login VALUES ('$login');


you can safely say -  $query=INSERT INTO login VALUES ('$login') ;


 mysql_query($query);
 mysql_close();
 ?

 Login is the name of the table on the database named test.

 I stopped using a password because it wouldn't let anything work even
table creation when I tried to use a password.  Any help that anyone could
give would be greatly appreciated; there is probably some grievious error in
this script.  Thanks, Chris


mentioning a password should do no harm. try  $query=INSERT INTO login
VALUES ('$login', password($password));
password() is a mysql function. its irreversible; somehting on the like that
we have on LiNUX systems

regards,
-shiva



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



RE: [PHP-DB] Calculating Time

2003-06-16 Thread Snijders, Mark
check the mktime() function

:-)


-Original Message-
From: Delz [mailto:[EMAIL PROTECTED]
Sent: maandag 16 juni 2003 11:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Calculating Time


Hi All,

How do I calculate time using php? Let's say I want to know the difference
between 12:30PM  13:30PM?
Hope someone can give me an idea?

Delz



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



RE: [PHP-DB] array fill/sort question

2003-06-11 Thread Snijders, Mark
hi,

no the both sollutions won't work cause:

I can't sort within a query cause subnetaddr is a varchar (10.10.10.10)

so it will be ordere like this

10.10.10.10
100.10.10.10
60.10.10.10

and that's not good cause 60 is smaller as 100, so with the function
ip2long() i will first make an integer of it


the second array solution you gave, won't work, cause I need ALL the query
results in the array, and that's the problem I can't handle


if I would do it like you said, I can sort it, but then I have a sorted
array and for each element I have to do a query again to get the other
fields of the table, and that's not good (2500 rows)

so can please still somebody help me with this?




-Original Message-
From: Becoming Digital [mailto:[EMAIL PROTECTED]
Sent: dinsdag 10 juni 2003 15:42
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] array fill/sort question


I might be overlooking something, but can't you just do this?

$query = SELECT s_id, subnet_name,subnetaddr,subnetmask,dnsdomain,
location, contact, ccn FROM subnets ORDER BY subnetaddr;


If you can't, you can sort the array like this.

?
$query = SELECT s_id, subnet_name,subnetaddr,subnetmask,dnsdomain,
location, contact, ccn FROM subnets;
$results = mysql_query( $query );

while ( $iptable = mysql_fetch_array( $result ) ) {
$iptable['subnetaddr'] = ip2long( $iptable['subnetaddr'] );
}
?

You can subsequently sort the array for the desired result.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message - 
From: Snijders, Mark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, 10 June, 2003 08:55
Subject: [PHP-DB] array fill/sort question


hi,

I'm working on a ipaddres/subnet programm

now i have a talbe with a lot of information about ip-addresses

i'm having this query:

SELECT s_id, subnet_name,subnetaddr,subnetmask,dnsdomain, location, contact,
ccn FROM subnets

the subnetaddr field looks like this : 100.20.20.1  and is ofcourse a
varchar field

BUT before displaying it on the screen i have to sort it by subnetaddr and
then show it

but i have to sort it as integer, so i use the php-function ip2long();

so you get a decimal...

so what i have to do:

do the query make a decimal field of the 'subnetaddr' put it in an array,
sort it and display it


BUT how can i put ALL of the fields in the query in an array, sort it, and
then display it?

please help me, I can't work it out :(

thanks, Mark




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



[PHP-DB] array fill/sort question

2003-06-10 Thread Snijders, Mark
hi,

I'm working on a ipaddres/subnet programm

now i have a talbe with a lot of information about ip-addresses

i'm having this query:

SELECT s_id, subnet_name,subnetaddr,subnetmask,dnsdomain, location, contact,
ccn FROM subnets

the subnetaddr field looks like this : 100.20.20.1  and is ofcourse a
varchar field

BUT before displaying it on the screen i have to sort it by subnetaddr and
then show it

but i have to sort it as integer, so i use the php-function ip2long();

so you get a decimal...

so what i have to do:

do the query make a decimal field of the 'subnetaddr' put it in an array,
sort it and display it


BUT how can i put ALL of the fields in the query in an array, sort it, and
then display it?

please help me, I can't work it out :(

thanks, Mark



RE: [PHP-DB] hotornot functionality

2003-05-29 Thread Snijders, Mark
i would do it totally different

if i understand you right.. you start with row number one, show it, give it
a rate, then show number 2, and show number 1 as last rated pic!!!

then you have the problem of reaching the last record!!

but !! i also see another problem:

if you do row 1,2,3,4  you always gets the first image , then the second etc
etc

what I would do:

take a random picture from the mysql table (you can use the mysql random
functin within a query for it)

then show this one!

give it a rate

then after rating it, put it in an array

then do a new random query but use the 'not in' function and don't select
the numbers what are in the array!!

so you get a new picture!

and the last rated pic is the picture at the last place in the array so you
can show it...

and when the array has equal number of rows as the table has, you showed
them all and you empty the array so they can start over

you get my point ? (sorry for my bad english)

how about this idea?

greeting , mark

-Original Message-
From: Matthew Horn [mailto:[EMAIL PROTECTED]
Sent: woensdag 28 mei 2003 14:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] hotornot functionality


I am toying with the idea of implementing functionality similar to the
hotornot.com site -- for a different purpose, mind you, but the same kind of
user experience. Here's what it does: 

1. A picture is served up.
2. User clicks on a radio button scale from 1 to 10 to rate the picture.
3. The page refreshes. The rating is re-computed with the user's rating for
the original picture. The original picture becomes that last rated pic,
and a new one is served up. 
4. The user can cycle through as many pictures this way as they want.

I have MySQL and PHP to work with.

What I am trying to do is figure out the best approach to implementing it.
Specifically, when the user clicks on the radio button, that triggers the
form submit via JavaScript. The form submit updates the database with the
rating and then fetches the next row.

The problem that occurred to me as I was putting together a prototype is:

I don't want the user to get the entire result set of all the images in the
database at once. I really want them to get just the two images (the one
they just rated and the one they are about to rate). Is there a way to
remember the last row they selected and then use that number to fetch the
next one on the subsequent request? I can keep recycling hidden form fields
with a number, which should work ok, but the problems come up when they
reach the last row.

Anyway, just looking to see if you folks have some ideas. I would prefer to
roll my own rather than use one of the available hotornot-style PHP
scripts to do this.



Matthew J. Horn

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



RE: [PHP-DB] Generate thumbnails from MySql database

2003-03-27 Thread Snijders, Mark
hi all,

cause a lot of people are asking for a thumbnail script:

some explenation:

this script makes 2 new pics of a uploaded pic, 1 thumbnail and 1 bigger
picture (but the bigger one will all be of the same size.. it's better

you also see this: if ($site==who-r-u){

this is because the sript is used on 2 servers , you can also see it like
this:

if ($site==who-r-u){   you have to use this part if you have GD 1
compiled with pph
}else{  this if you have gd2 compiled on your pc  so pic the right one and
trow away the rest!!!  but with gd2 the pics will be a lot better.

on http://www.nederlandmobiel.nl you can see how it is used!!

please don't mail me all back what the functions are doing, but go to
www.php.net and look them up

hope it helps you

-mark-



function image_create($image, $url, $name){

$inputImg = ImageCreateFromJPEG($image);

$srcX = imagesx($inputImg);
$srcY = imagesy($inputImg);

// image size thumbnail
$dstY_1 = 45; // height (altijd hetzelfde)
$maxX_1 = 60; // widthe (als plaatje is kleiner dan centreren)

// image size big foto
$dstY_2 = 210; // hoogte (altijd hetzelfde)
$maxX_2 = 280; // breedte (als plaatje is kleiner dan centreren)

$ratio_1 = ($srcY / $dstY_1);
$dstX_1  = ($srcX / $ratio_1);

$ratio_2 = ($srcY / $dstY_2);
$dstX_2  = ($srcX / $ratio_2);

if ($site==who-r-u){
  $outputImg_1 = ImageCreate($maxX_1, $dstY_1);
  $outputImg_2 = ImageCreate($maxX_2, $dstY_2);
}else{
  $outputImg_1 = imagecreatetruecolor($maxX_1, $dstY_1);
  $outputImg_2 = imagecreatetruecolor($maxX_2, $dstY_2); 
}

imagefill($outputImg_1, 0, 0, ImageColorAllocate($outputImg_1, 255, 255,
255));
imagefill($outputImg_2, 0, 0, ImageColorAllocate($outputImg_2, 255, 255,
255));

if ($site==who-r-u){
  ImageCopyResized($outputImg_1, $inputImg,(($maxX_1 - $dstX_1) /
2),0,0,0,$dstX_1, $dstY_1, $srcX, $srcY);
  ImageCopyResized($outputImg_2, $inputImg,(($maxX_2 - $dstX_2) /
2),0,0,0,$dstX_2, $dstY_2, $srcX, $srcY);
}else{
  imagecopyresampled($outputImg_1, $inputImg,(($maxX_1 - $dstX_1) /
2),0,0,0,$dstX_1, $dstY_1, $srcX, $srcY);
  imagecopyresampled($outputImg_2, $inputImg,(($maxX_2 - $dstX_2) /
2),0,0,0,$dstX_2, $dstY_2, $srcX, $srcY);
}

imagejpeg($outputImg_1, $url.thumbnails/$name);
imagejpeg($outputImg_2, $url.$name);
}



RE: [PHP-DB] date to Y-M-D

2003-03-25 Thread Snijders, Mark
ehmmm what kind of dates do you use, maybe dates of birth?

when using date of unix timestamp you can't have dates befor 1970  so if
those timestamps represents an older date you can't use timestamps!

-mark-


-Oorspronkelijk bericht-
Van: David Rice [mailto:[EMAIL PROTECTED]
Verzonden: Tuesday, March 25, 2003 3:42 PM
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP-DB] date to Y-M-D


a function to convert any date to ymd...


function datetoymd($date){
$dateymd = date('Y-m-d',$date);

return $dateymd;
}

this function when output gives me the date 1970-01-01 (date of the unix 
timestamp start) so, ehm, why!?

cheers,
dave





_
Stay in touch with absent friends - get MSN Messenger 
http://messenger.msn.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] MySQL or Postgres

2003-03-24 Thread Snijders, Mark
hi,

Ih ate people being so lazy..

open google and type the words: mysql postgres

and you get enough results, here i looked one up for you:

http://www.mmlabx.ua.es/mysql-postgres.html
http://www.mmlabx.ua.es/mysql-postgres.html 



___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Ben Edwards [ mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ]
Sent: maandag 24 maart 2003 12:03
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL or Postgres


Could someone please point me in the correct direction for a decent
comparison of the two in respect of:-

   Reliability
   Scalability
   Speed
   Functionality

These are actually in order or importance to me (I know both are fairly
fast).

I am also interested in how easy it would be to migrate from MySQL to
Postgress.

Proples general experiences/comments also welcome.

Beb


* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com
http://www.criticaldistribution.com  *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org
http://www.cultureshop.org  *
* i-Contact Progressive Video  http://www.videonetwork.org
http://www.videonetwork.org  *
* Smashing the Corporate image   http://www.subvertise.org
http://www.subvertise.org  *
* Bristol Indymedia   http://bristol.indymedia.org
http://bristol.indymedia.org  *
* Bristol's radical news http://www.bristle.org.uk
http://www.bristle.org.uk  *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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

RE: [PHP-DB] MySQL or Postgres

2003-03-24 Thread Snijders, Mark
sorry the url I gave was of a weird language..

this one is better:

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



-Original Message-
From: Ben Edwards [mailto:[EMAIL PROTECTED]
Sent: maandag 24 maart 2003 12:03
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL or Postgres


Could someone please point me in the correct direction for a decent 
comparison of the two in respect of:-

   Reliability
   Scalability
   Speed
   Functionality

These are actually in order or importance to me (I know both are fairly
fast).

I am also interested in how easy it would be to migrate from MySQL to 
Postgress.

Proples general experiences/comments also welcome.

Beb


* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *



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



[PHP-DB] [php] file open

2003-03-24 Thread Snijders, Mark
hello,

i'm using the next code:

$fp=fopen(WBSMUTA.CSV,r);
while (!(feof($fp))) {
$data_file=fgets($fp,4096);
echo br$data_filebr;


}

to open a file...

but I want to read it from line 3.. and there is a special function for, but
can't find it back :(

can someone tell me the name of this funcion?

I know I can also use a counter into the while-loop, but I know there is a
better sollution for..

thanks


___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.


 



RE: [PHP-DB] Substring ?

2003-03-20 Thread Snijders, Mark
www.php.net

function: substr

and you'll see

please first search, then ask!



-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED]
Sent: donderdag 20 maart 2003 9:13
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Substring ?


I know how to use it with MySQL but how do you use the function
substring with a variable?
 
Thanks
 
Dallas Freeman


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



RE: [PHP-DB] SELECT * FROM Command

2003-03-19 Thread Snijders, Mark
guess it is hard to answer this with so less information

first show us how the table defenition is... how it is build up and then
which fields you want to show to the user!

then I or others can help you much more!!



___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.




-Original Message-
From: Michelle Whelan [ mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ]
Sent: woensdag 19 maart 2003 9:06
To: [EMAIL PROTECTED]
Subject: [PHP-DB] SELECT * FROM Command



Hi,

I have a question about how to display results.  I am using PHP with a mysql
database through yahoo webhosting.  I've created a form (html  javascript)
that lets the user post data to one of the tables in my database.  On a
separate page, I've created a form that will do a SELECT * FROM search (by
zipcode) on the database that the user posted data to. 

Now here's my question..

I want the query to search the db and return results for matching zip  codes
and display that plus the other info that was posted by the user. 

I have it right now so that the results displayed are simply only the zip
code that matches is coming back and it displays how ever many times in
matches.

I hope this makes sense.

Thanks in advance for any help.

Michael




RE: [PHP-DB] listbox not adding data to mySql?

2003-03-13 Thread Snijders, Mark
put in top of your document :

phpinfo();

and see under 'variables' what is in them



-Original Message-
From: Rich Gray [mailto:[EMAIL PROTECTED]
Sent: donderdag 13 maart 2003 10:22
To: Billy; PHP-DB
Subject: RE: [PHP-DB] listbox not adding data to mySql?


 Im having a problem getting listbox data to go into a mySql database.

 This may be a simple problem but Ive been searching with out any
 result, and
 thought I would ask on here.

 Here goes...

  select name=server
   option value=NoNo/option
   option value=YesYes/option
  /select

 the name of the field in the database is server, all of the other inputs
 that I have within the page work and enter data but when I try using
 listbox's it doesnt seem to work.

 Cheers if any one can help me with this

 Rujlon

Can you post the code that handles the form data and updates the database?
Without that it'll be difficult to see what's the problem.

Rich


-- 
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] Where have my errors gone?

2003-03-13 Thread Snijders, Mark
I know,

it's really anoing

some errors are syntax errors which you can't see

the way I look them up:


put a exit;  in the middle of the page...

you still see nothing, put the exit; higher in the code.. to that until you
see some output again, then you know the syntax error is somewhere below the
exit;

get my point?

-mark-


-Original Message-
From: Alex Francis [mailto:[EMAIL PROTECTED]
Sent: donderdag 13 maart 2003 12:11
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Where have my errors gone?


If I had a syntax error, I used to get a message back telling me. Now I just
get a blank page.
I have tried adding error_reporting=E_ALL; to the page, but still no errors.



-- 
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] sorting problem...

2003-03-13 Thread Snijders, Mark
guess you can better take a look at the group by function of mysql



-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]
Sent: donderdag 13 maart 2003 15:03
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] sorting problem...


Take a look at the MySQL DATE_FORMAT() function.

Ignatius

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 2:43 PM
Subject: [PHP-DB] sorting problem...


 Hi All,
 
 I need to sort some data from a MySQL table. I have data saved like this:
 
 ++-++--+
 | id | unixtime| porta_snmp | porta_switch |
 ++-++--+
 |  1 | 2003-01-07 12:23:24 | 1614   | 1|
 |  2 | 2003-01-07 12:24:01 | 1614   | 1|
 |  3 | 2003-01-07 12:29:34 | 1614   | 1|
 |  4 | 2003-01-07 12:30:19 | 1614   | 1|
 |  5 | 2003-01-07 12:31:01 | 1614   | 5|
 |  6 | 2003-01-07 12:32:06 | 1614   | 5|
 |  7 | 2003-01-07 12:33:01 | 1614   | 1|
 |  8 | 2003-02-07 12:34:06 | 1614   | 1|
 |  9 | 2003-02-07 12:35:00 | 1614   | 1|
 | 10 | 2003-02-07 12:36:01 | 1614   | 1|
 ++-++--+
 
 I neet to sort the data to be able to read it better. In this case I just
 need to filter the data to get only the different info for each day. Some
 thing like this:
 
 2003-01-0716141
 2003-01-0716145
 2003-02-0716141
 
 Is this possible ?
 
 Thank's in advance,
 Gus
 
 
 
 -- 
 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] Don't Understand

2003-03-12 Thread Snijders, Mark
no there is no other way, and it is pritty easy if you get it..

i've made a special function for it, but got the code @ home

but read this:

http://www.php.net/manual/nl/function.imagecopyresized.php

and especially the user comments.. they are always very usefull

goodluck



-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED]
Sent: woensdag 12 maart 2003 12:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Don't Understand


Help!
 
I don't understand how to use the gdImageCopyResized
 
gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
int srcX, int srcY, int destW, int destH, int srcW, int srcH)
 
Thanking You
 
 
Dallas Freeman
 
* is there a simpler way to change the size of an image?


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



RE: [PHP-DB] Don't Understand

2003-03-12 Thread Snijders, Mark
that's bull

on www.marksnijders.com and www.nederlandmobiel.nl i use those scripts (php
and the GD functions ) for automatically changing the file size...




-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED]
Sent: woensdag 12 maart 2003 12:58
To: 'mike karthauser'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Don't Understand



By the looks of it, I will have to create something in Delphi or
some-type of web application.

Thanks,

Dallas Freeman









-Original Message-
From: mike karthauser [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 12 March 2003 9:50 PM
To: Dallas Freeman
Subject: Re: [PHP-DB] Don't Understand

on 12/3/03 11:45 am, Dallas Freeman at [EMAIL PROTECTED] wrote:

 Thanks, very useful!  Can you direct me where for help on getting an
 image to resize before it is even uploaded (inother words, it will
 resize itself on the end-user's machine and then upload to the
 database).

I very much doubt that a server side script can do this. You need
something
clientside. We use macromedia fireworks.

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ




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

2003-02-28 Thread Snijders, Mark
go to mysql.com en look for date



-Original Message-
From: Jorge Miguel Fonseca Martins [mailto:[EMAIL PROTECTED]
Sent: vrijdag 28 februari 2003 16:23
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Date


How can a make a query that lists all the fields where a datefield as
the date of tomorow?
 
thanks
 


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



[PHP-DB] mysql to cvs file to excel

2003-02-21 Thread Snijders, Mark
hello,

does anybody know if it's possible (without php)

to export data from mysql to a cvs file, so i can import it in excel???

so is it possible, and if yes.. how?

thanks kinds regards,

Mark Snijders





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




[PHP-DB] sorting a multimensional array

2003-02-19 Thread Snijders, Mark
hello,

i've got the next array:

Array
(
[testsubnet] = Array
(
[2690910720] = 255.255.255.0
)

[GLN-subnetsirangevoorgedelegeerddomein] = Array
(
[2886735616] = 255.255.255.0
)

[testsubnet2] = Array
(
[1209360384] = 255.255.224.0
)

[lpd (tpg-nl1)] = Array
(
[175964160] = 255.255.0.0
)
}

I need to sort it by name or by the big nummer between []

to sort it by name i do this:

ksort($ARRAYNAME);

and it works fine, but how do I sort by the big number between []  ...

I really don't get it...

thanks for the help..

Mark,



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




RE: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Snijders, Mark
$start = 10;

$numbers_to_show = 25;

$sql = SELECT * FROM bla Limit $start, $numbers_to_show;

or just go to mysql.com and use the manual :)

-Original Message-
From: Noam Giladi [mailto:[EMAIL PROTECTED]]
Sent: woensdag 19 februari 2003 16:00
To: [EMAIL PROTECTED]
Subject: [PHP-DB] LIMIT problem MSSQL


I'm trying to split results into different pages and number the pages
accordingly.  I've been able to build a fairly intelligent page numbering
system which knows which rows it should pull (at least by numbering each row
numerically) but I don't know how to construct a SQL query to pull 10
results starting at a certain number.

please  did anyone wrote a proc that do it?.




-- 
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] Empty form variables

2003-02-18 Thread Snijders, Mark
sometimes people really never use a search :(((

but the answer is:

php versions  4 use another way of handeling postvars and arrays

and if users don't know where the values are, use the function:
phpinfo();  !!!

and try this:

print_r($_POST);

thats all i will say



-Oorspronkelijk bericht-
Van: Diego Pedrosa [mailto:[EMAIL PROTECTED]]
Verzonden: Tuesday, February 18, 2003 12:45 PM
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP-DB] Empty form variables


Hi all:

I've installed apache for win98 and php 4.2 (also for 
win98) and they are working fine but I'm having problems 
with the form variables.
When I submit a form the variables are empty!!!

If anyone knows of issues in php-apache-win configuration 
please let me know.

Thanks.






_

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.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] Getting values back out of a URL

2003-01-23 Thread Snijders, Mark
forget that code

just do this


$parcel_query = SELECT * FROM land01_02_03 WHERE (PelNumber LIKE 
'$_GET[number]%') AND (OnerName1 LIKE '$_GET[owner]%') ;


do this for seeing the url values:

print_r($_GET);







I am trying to get my values back out of a URL that has been passed from a 
page with a form. Here's what the URL looks like.

searchresult.php?number=01owner=smithSubmit=Submit

My mySQL query is working properly if I hard code a value in, but I can seem

to extract the values of number and owner. Here is the code I was told to 
try previously:

?
  while (list($var, $value) = each($HTTP_POST_VARS)) {
 ${$var} = $value;
  }
?

And here is my mySQL query:

$parcel_query = SELECT * FROM land01_02_03 WHERE (PelNumber LIKE 
'${number}%') AND (OnerName1 LIKE '${owner}%') ;


If anyone could help me out, it would be really great.

Thanks,
Danialle


_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


-- 
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] Concatenate two strings

2003-01-15 Thread Snijders, Mark
with a dot

$valor=$valor1 .   . $valor2

:-)





-Original Message-
From: Bruno Pereira [mailto:[EMAIL PROTECTED]]
Sent: woensdag 15 januari 2003 15:48
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Concatenate two strings


How can i join two strings.
My code is something like:
$valor1=bruno;
$valor2=Pereira;
$valor=$valor1 +   + $valor2

Can someone help me. Thanks.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]


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

2003-01-09 Thread Snijders, Mark

when using start_session

the code tries to write a file to the tmp dir...

think you are working under windows

so make in c: a \tmp dir !!!

then it should work



-Original Message-
From: khac duy [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 10 januari 2003 1:08
To: [EMAIL PROTECTED]
Subject: [PHP-DB] help me


  i can't use start_secsion(); in php4, it say:
 error : can't ofen(\tmp/4363jghsfjkhshga.. like this...



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




RE: [PHP-DB] how use random in php

2003-01-09 Thread Snijders, Mark
check

www.php.net and search for array... then you will get a list of all the
array functions

try to find it out yourself first please

-mark-

-Original Message-
From: khac duy [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 10 januari 2003 1:15
To: [EMAIL PROTECTED]
Subject: [PHP-DB] how use random in php


  in php only support shuffe(); function,i want random a array,how 


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




RE: [PHP-DB] Passing selection to next page

2002-12-19 Thread Snijders, Mark

I guess this all is in a form

so on the next page it should be in:

echo $_POST[department];

or in

echo $department   depending on the php version





-Original Message-
From: Alex Francis [mailto:[EMAIL PROTECTED]]
Sent: donderdag 19 december 2002 12:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Passing selection to next page


I have a drop down list created using the following code and am having
trouble passing my selection to the next page. Can anyone help?

?
$query = select distinct department from courses order by department;
$result = mysql_query($query);

echo SELECT ID='Category Combo Box' NAME='department';
echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;

While ($row = mysql_fetch_assoc($result))
{
   echo OPTION VALUE=';
   echo stripslashes($row[department]);
   echo ' ;
   echo stripslashes($row[department]);
   echo /OPTION;
}

echo /SELECT;
mysql_free_result($result);
?




-- 
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] Variables de SESSION dentro de funciones PHP

2002-12-13 Thread Snijders, Mark
english please!!!



___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: _netPerceptions?= [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 13 december 2002 12:33
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Variables de SESSION dentro de funciones PHP


Hola,
 
tengo una función en PHP que me lee de un fichero una configuración de
unas tablas de BBDD, quiero que el nombre de las tablas así como los
datos de conexión, me queden residentes en unas variables de sesión.
Cuando registro las variables dentro de la función, al acceder desde
cualquier otro punto con $HTTP_SESSION_VARS[nombrevariable] me pone
como que está vacía.
 
¿alguien podría aclararme el tratamiento de estas variables en PHP?
 
Saludos y muchas gracias.


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




RE: [PHP-DB] Re: flytte bsd harddisk til anden pc

2002-12-12 Thread Snijders, Mark
it's swedish or something..

i don't get it and i'm dutch

if the person understands knulla then he's swedish :)

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Radovan Radic [mailto:[EMAIL PROTECTED]]
Sent: donderdag 12 december 2002 14:30
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: flytte bsd harddisk til anden pc


Dutch, swedish...?

Martin Allan Jensen [EMAIL PROTECTED] wrote in message
002501c2a1e2$092e8640$020a@asus">news:002501c2a1e2$092e8640$020a@asus...
Hej Allesammen, har et strt problem, jeg skal IDAG skifte server, men kan
jeg bare tage mine harddiske med FreeBSD på og smide over i den nye maskine
og så vil det køre eller 



-- 
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: flytte bsd harddisk til anden pc

2002-12-12 Thread Snijders, Mark
oh :)

i never check those extensions... to busy for... and also tired from the
overload of boost (do programmers drink to much?? :--))

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]]
Sent: donderdag 12 december 2002 14:39
To: Snijders, Mark; 'Radovan Radic'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: flytte bsd harddisk til anden pc


I'm pretty sure the .dk on the end of his e-mail address means Denmark. Glad
you guys were confused too. I was afraid that last shot of Tequila at the
bar last night really screwed me up.

 -Original Message-
 From: Snijders, Mark [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 12, 2002 8:31 AM
 To: 'Radovan Radic'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Re: flytte bsd harddisk til anden pc
 
 
 it's swedish or something..
 
 i don't get it and i'm dutch
 
 if the person understands knulla then he's swedish :)
 
 ___ 
 
 Mark Snijders, Developer 
 Atos Origin 
 Groenewoudeseweg 1, Room VN-515 
 5621 BA  Eindhoven, The Netherlands 
 *   : [EMAIL PROTECTED] 
 *:+31 (0)40 - 2785992 (tel) 
 * : +31 (0)40 - 2788729 (fax) 
 
 The information in this mail is intended only for use of the 
 individual or
 entity to which it is addressed and may contain information that is
 privileged, confidential and exempt from disclosure under 
 applicable law.
 Access to this mail by anyone else than the addressee is 
 unauthorized. If
 you are not the intended recipient, any disclosure, copying, 
 distribution or
 any action taken omitted to be taken in reliance of it, is 
 prohibited and
 may be unlawful.
 
 
 
 -Original Message-
 From: Radovan Radic [mailto:[EMAIL PROTECTED]]
 Sent: donderdag 12 december 2002 14:30
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: flytte bsd harddisk til anden pc
 
 
 Dutch, swedish...?
 
 Martin Allan Jensen [EMAIL PROTECTED] wrote in message
 002501c2a1e2$092e8640$020a@asus">news:002501c2a1e2$092e8640$020a@asus...
 Hej Allesammen, har et strt problem, jeg skal IDAG skifte 
 server, men kan
 jeg bare tage mine harddiske med FreeBSD på og smide over i 
 den nye maskine
 og så vil det køre eller 
 
 
 
 -- 
 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] Catalog

2002-12-11 Thread Snijders, Mark
jou want to make it yourself even without nowing how to code it or how to
set up a database design??? 

just by looking to other code??

think it will be to hard for a first project.. just my idea...

kind regards,

Mark



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




RE: [PHP-DB] php- odbc- access

2002-12-11 Thread Snijders, Mark
don't think it's possible @ once...

what  I suggest... those people have to make a comma delimited export file,
then you make an upload page, where people can upload this file. and you
make a script so it will be imported

get the point?

kind regards



 

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



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


RE: [PHP-DB] Enlarging tables

2002-12-09 Thread Snijders, Mark
http://www.mysql.com

and check 'alter table' with this you can fix it

but using phpmyadmin or another program is more handy


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




RE: [PHP-DB] some data output formatting and grouping question...

2002-12-02 Thread Snijders, Mark
I think you should first make a new datamodel, cause if I see this, it isn't
right

(just my 2 cents)

:-)


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




RE: [PHP-DB] SQL Guru Question:

2002-11-26 Thread Snijders, Mark
don't think it won't work all in mysql... but what db are we talking about?


Well, have you tried it like that?
If that doesn't work you could try this:

select
@calc:=(round(pr_contents * 12)+ round(pr_buildings * 12)),
(@calc * .33) as agent,
(@calc * .5) as manager
from pipeline

Regards
Joakim


-- 
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] using php4 to connect to mysql (newbie question)

2002-11-20 Thread Snijders, Mark
read this

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


and other stuff on http://www.php.net


good lukck


___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: mike karthauser [mailto:[EMAIL PROTECTED]]
Sent: woensdag 20 november 2002 13:09
To: [EMAIL PROTECTED]
Subject: [PHP-DB] using php4 to connect to mysql (newbie question)


hi,
I'm new to php and mysql and are trying to find some tutorials that i can
work through so i can get my head round connecting php4 to mysql.

I have been looking in all the usual places but keep finding php3 examples
and also examples using globals on..

The one i have been looking at is http://www.devarticles.com/art/1/23
All fine until it starts using globals...

My dev server is running php4.2.3 with globals off, mysql 3.23.52 on freebsd
4.7 stable.

Can anyone recommend any good tutorials for my query?

thanks
mikek
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


-- 
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] using php4 to connect to mysql (newbie question)

2002-11-20 Thread Snijders, Mark
on www.php.net is the same info and more and it's free :-)



___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Steve Dodkins [mailto:[EMAIL PROTECTED]]
Sent: woensdag 20 november 2002 13:25
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] using php4 to connect to mysql (newbie question)


Hi

The latest PHP bible is now updated to 4.2

www.troutworks.com



-Original Message-
From: Snijders, Mark [mailto:[EMAIL PROTECTED]]
Sent: 20 November 2002 12:18
To: 'mike karthauser'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] using php4 to connect to mysql (newbie question)


read this

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


and other stuff on http://www.php.net


good lukck


___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: mike karthauser [mailto:[EMAIL PROTECTED]]
Sent: woensdag 20 november 2002 13:09
To: [EMAIL PROTECTED]
Subject: [PHP-DB] using php4 to connect to mysql (newbie question)


hi,
I'm new to php and mysql and are trying to find some tutorials that i can
work through so i can get my head round connecting php4 to mysql.

I have been looking in all the usual places but keep finding php3 examples
and also examples using globals on..

The one i have been looking at is http://www.devarticles.com/art/1/23
All fine until it starts using globals...

My dev server is running php4.2.3 with globals off, mysql 3.23.52 on freebsd
4.7 stable.

Can anyone recommend any good tutorials for my query?

thanks
mikek
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


-- 
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] checking for 0 results?

2002-11-15 Thread Snijders, Mark
and how does $sql now gets in touch with $result




Or you can skip a step like:

$sql = select * from ietsfuckingfriday;

if (mysql_num_rows($result) == 0) {

do_something();

} else {

do_anotherthing();

}

Aaron

-Original Message-
From: Snijders, Mark [mailto:Mark.Snijders;atosorigin.com] 
Sent: November 15, 2002 8:26 AM
To: 'Jonathan Narong'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] checking for 0 results?

$sql = select * from ietsfuckingfriday;

$result = mysql_query($sql);

$num_rows=mysql_num_rows($result);

if ($num_rows==0)echo yesss we did it;


(sorry it's friday :-)

almost can go home :--)



-Original Message-
From: Jonathan Narong [mailto:jon;binaryillusions.com]
Sent: vrijdag 15 november 2002 14:23
To: [EMAIL PROTECTED]
Subject: [PHP-DB] checking for 0 results?


maybe i'm totally not thinking straight right now, but is there a way in
php
to check if 0 results are returned in a mysql query?

for example, i have a definition database, that has a list of letters
the
user clicks on (click on the letter, and all the terms for that letter
pop
up).. but for some letters there are no terms. so i just wanted to echo
out
a simple no terms message or something. in any case, i need to check
if
there are no results from a mysql query (an error won't be returned).

thanks ..

-jon



-- 
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] PHP 4 inserting data in MySQL 3.23

2002-11-13 Thread Snijders, Mark
try before the :
if ($submit) 

this:

phpself();

the vars are now declared on a different way in the new phph versions


you need to do:

if ($_POST[submit]){


and the insert values are also now :

echo $_POST[phone];

so check phpinfo(); there are all the vars you need...

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Josh Jones [mailto:bootsec99;yahoo.com]
Sent: woensdag 13 november 2002 14:25
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP 4 inserting data in MySQL 3.23


I'm running the following setup:
Apache 2.0.40-8
MySQL 3.23.52-3
PHP 4.2.2-8.0.5

I have no problems retreiving data from the database
and posting it to a website, but I can't insert data
from the website to the database via forms or
whatever.

I'm new to this, but I've triple checked all the
permissions and the code - it all works fine from the
MySQL command line. I can't find any errors in the
logs either, maybe I'm looking in the wrong place.

Here's a sample of some testing code:

html
body

?php

$db = mysql_connect(localhost, webuser);

mysql_select_db(example,$db);

$result = mysql_query(SELECT * FROM mytable,$db);

echo table border=1\n;

echo trtdName/tdtdPhone/tr\n;

while ($myrow = mysql_fetch_row($result)) {

printf(trtd%s/tdtd%s/td/tr\n, $myrow[0],
$myrow[1]);

}

echo /table\n;

?

/body
/html

html
body

?php

if ($submit) {

  // process form

  $db = mysql_connect(localhost, webuser);

  mysql_select_db(example,$db);

  $sql = INSERT INTO mytable (name, phone) VALUES
('$name','$phone');

  $result = mysql_query($sql);

  echo Thank you! Information entered.\n;

} else{

  // display form

  ?

  form method=post action=?php echo $PHP_SELF?

  Name:input type=Text name=namebr

  Phone:input type=Text name=phonebr

  input type=Submit name=submit value=Enter
information

  /form

  ?php

} // end if

?

/body
/html

Any help or direction pointing would be appreciated.

Thanks
 

__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

-- 
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] Find out a pic size?

2002-11-11 Thread Snijders, Mark
check this out:

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


you need de GD limbrary you can check with phpinfo() if you already got
it


good luck



___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: [EMAIL PROTECTED] [mailto:joakim.andersson;cybercom.se]
Sent: maandag 11 november 2002 8:56
To: [EMAIL PROTECTED]
Subject: SV: [PHP-DB] Find out a pic size?


 Hi, 
  
 I'm working with a lot of picture in a website and the size is not
 always the same.
  
 I need some help on how to find out the size (width and height) of a
 picture. Is there any way to do this (especially with PHP)? 
  
 I need it so I can calculate the width and height to be 
 specified on the
 HTML img tag.
  
 Thanks,
  
 Hansen
 IndoInformatika

Did you try the manual at all?
GetImageSize() is what you're looking for.

Regards
Joakim

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

2002-11-08 Thread Snijders, Mark
check out the nl2br() function!!


good luck





-Original Message-
From: Siamak Sadeghianfar [mailto:siamak116;hotmail.com]
Sent: vrijdag 8 november 2002 15:31
To: [EMAIL PROTECTED]
Subject: [PHP-DB] textarea!!


Hi
I've written a guestbook in php
user writes a message in a texarea and in the code I insert it in a table 
and then in showpage I sow it to him.before I insert the message into table 
, I use addslashes() and htmlspecialchars(). the prblem is that , when I 
retrieve the message from the table all sentences are after each other , and

there's no break that makes a bad appearance.
I mean for example someone write in the texarea as following :
--
Hi
how r u?
what happened there?!
--

when I show the message to him the appearance is this way :
--
Hi how r u? what happened there?!
--

what should I do to show him exactly how he wrote the message?

thanx

_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


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

2002-11-06 Thread Snijders, Mark
if i get your point: 

1 event can have more dates.. and you wanna show for each event just the
first date...


so you wanna show more from one table as the other one

in that case you should try to use the left join !! so check the manual on
left join



-Original Message-
From: Terry Romine [mailto:eatrom;blazing-trails.com]
Sent: woensdag 6 november 2002 15:55
To: [EMAIL PROTECTED]
Subject: [PHP-DB] sort by date


I have two tables, one contains event information and the other dates 
that the event takes place:

| id| int(11)  |  | PRI | 0   | auto_increment |
| title | varchar(100) | YES  | | NULL||
| location  | varchar(100) | YES  | | NULL||
| address   | varchar(100) | YES  | | NULL||
| contact   | varchar(100) | YES  | | NULL||
| category  | varchar(100) | YES  | | NULL||
| event_time| varchar(200) | YES  | | NULL||
| urllink   | varchar(100) | YES  | | NULL||
| descript  | text | YES  | | NULL||

| id | int(11) |  | PRI | 0   | auto_increment |
| event_key  | int(11) | YES  | | NULL||
| event_date | date| YES  | | NULL||

They are linked via dateTable.event_key=eventTable.id

I want to be able to sort by the first date that the event takes place. 
I tried:
$sql=select e.*,d.event_date from eventTable e,dateTable d where 
e.id=d.event_key order by d.event_date,d.event_key

but it still shows each date that the event takes place. I tried doing 
a min(d.event_date) as event_date and then group by instead of order 
by but still get too many results.

Any help to straighten this out?


Terry


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

2002-11-06 Thread Snijders, Mark
why does everybody always gives the answers?? why not a hint, or where to
search that they can learn something about it???





-Original Message-
From: Marco Tabini [mailto:marcot;inicode.com]
Sent: woensdag 6 november 2002 16:08
To: Terry Romine
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] sort by date


Ok, going out on a limb here... have you tried something like

select e.id, title, location, address, contact, category, event_time,
urllink, descript, min(event_date) from eventTable e inner join
dateTable d on e.id = d.id group by e.id

?


Marco

-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide  magazine dedicated to PHP programmer

Come visit us at http://www.phparch.com!




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




RE: [PHP-DB] Check If Table Exists

2002-11-04 Thread Snijders, Mark
not to make a point but the F = fucking and not fine :-)




-Original Message-
From: David Robley [mailto:robleyd;paradise.net.nz]
Sent: maandag 4 november 2002 9:46
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Check If Table Exists


In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...
 
RTFM?
 
Read The Fine Manual

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
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] Am I doing This Right?

2002-11-01 Thread Snijders, Mark
or just do

phpinfo(); en check all the vars

cause in the latest php versions it could be that you have to use
$_POST[.. etc..

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Mohammad Saad [mailto:m_saad;khi.comsats.net.pk]
Sent: vrijdag 1 november 2002 11:11
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Am I doing This Right?


check the values of these variables

$rTemp = $HTTP_POST_FILES['replay_file']['tmp_name'];
$rName = $HTTP_POST_FILES['replay_file']['name'];
$rSize = $HTTP_POST_FILES['replay_file']['size'];

// Define Replay Upload DIR and FILE name
$rFile = $db_nextid._.$HTTP_POST_FILES['replay_file']['name'];
$rLoc = files/war3-replays/$rFile;

they should contain some value , one more thing , mite be the case that
$HTTP_POST_FILES['replay_file']['tmp_name'] should be
$HTTP_POST_FILES['REPLAY_FILE']['TMP_NAME]

do one thing, print_r($HTTP_POST_FILES); this should show you what that
array contains
Good Luck

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 01, 2002 2:45 PM
Subject: Re: [PHP-DB] Am I doing This Right?



After I submit the file, it goes back to the form, even though in
the
 script, it says to go to the database and move the uploaded file to a new
 DIR.

It ignores it as if the file wasn't uploaded.

As for printing out the variables. All my important variables are
 $HTTP_POST_FILES and those are all null.



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

2002-10-23 Thread Snijders, Mark
select date from table_name where name='test' GROUP BY date


-Original Message-
From: Chris Grigor [mailto:chris;calibre.co.za]
Sent: woensdag 23 oktober 2002 14:04
To: PHP Gen; PHP DB
Subject: [PHP-DB] Duplicates


Howdi all,

How can you list the contents of a table and skip duplicate Dates??
eg

select Date from table_name where name = 'Test';


|Date|

2000-01-01
2000-01-02
2000-01-02   --- How would you get rid of this duplicate date (without
deleting it ;-))?

I want to just get a list of dates in the table that querys have been
inserted, but not duplicate dates...

Say for instance I had 1 entry on 2000-01-01, and I had 10 entrys on
2000-01-02 I want it to tell me that
there is a date for 2000-01-01 and a date for 2000-01-02, not for it to tell
me there is 10 entrys on 2000-01-02

Any help would be appreciated

Many Thanks guys





--
Chris Grigor

Calibre Clinical Consultants

--



-- 
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 data from next row? (mysql)

2002-10-14 Thread Snijders, Mark

if you want to access stuff from row 3 while being in row 2.. you first have
to put it all into an array.. and then you coul do that.. but i can't comup
with something where you need something like that.. a strange idea...?

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: maandag 14 oktober 2002 9:47
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Accessing data from next row? (mysql)


I know that, but what if I need to access data from the next row?  If I 
have 3 rows, is there a way to access something from row 3 while the 
loop is in row 2, but still have the loop go to row 3 when it's done 
with row 2?

John W. Holmes wrote:

Using mysql, how do I access the data of the next row using code
something like this:
$result = mysql_query(select column from table where
whatever='whatever');
while($array = mysql_fetch_array($result)){
//Whatever
}



Each iteration of the while loop will fetch a row for you and it's
contents will be in the $array[] array. Try echo $array['column'];
inside of your while to see what I'm talking about.

---John Holmes...



  


-- 
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




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




RE: [PHP-DB] Re: easier way to do this? (time interval)

2002-10-11 Thread Snijders, Mark


maybe i dont get the question, 

but for all records for the last 24 hours (1 day) i use:

this is an insteresting page:

http://www.mysql.com/doc/en/Date_and_time_functions.html


i says:

Here is an example that uses date functions. The following query selects all
records with a date_col value from within the last 30 days: 

mysql SELECT something FROM tbl_name
   WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) = 30;


so for 24 hours... change the 30 in 1 :)   is this what you mean?

bye,

mark snijders




-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 11 oktober 2002 12:23
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: easier way to do this? (time interval)


In article 
[EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Hello,
 
 Curious if there is an easier way to do this (using just SQL and not PHP).
 SQL seems powerful enough to do this but can't think of the synatx.  Note,
I
 am using MySQL so no sub-selects (or other useful items).  Basically
trying
 to pull all records for a 24 hour period but instead of -2400,
 0700-0700 (next day).
 
 if (date(H)7){
 
   $query=mysql_query(
 SELECT dtg 
 FROM techs 
 WHERE 
   tech='$user'
 AND
   DAYOFMONTH(NOW())=DAYOFMONTH(dtg)
 AND
   HOUR(dtg)=7
   );
 
 } else {
 
   $query=mysql_query(
 SELECT dtg 
 FROM techs 
 WHERE 
   tech='$user' 
 AND 
 (
   (DAYOFMONTH(NOW())=DAYOFMONTH(dtg) AND HOUR(dtg)7)
   OR
   ((DAYOFMONTH(NOW())-1)=DAYOFMONTH(dtg) AND HOUR(dtg)=7)
 )
   );
 
 }
 
 Cheers,
 
 -peter

I'd imagine that with a judicious use of mysql's IF statement and 
HOUR(NOW()) you could do pretty much what you want. I can't be hanged 
going through the docs right now, or I'd have a try at the syntax for you 
:-)

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
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] Error query : mysql_result

2002-10-10 Thread Snijders, Mark

would be nice if you would tell which line is 140



-Original Message-
From: Burgess [mailto:[EMAIL PROTECTED]]
Sent: donderdag 10 oktober 2002 11:14
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Error query : mysql_result


Hi

I have used the mysql_result function to return some specific information
from database.  The information is returned as it should but I keep getting
this error message:

Warning: Unable to jump to row 0 on MySQL result index 4 in
/u1.bath/s31/eh842/public_html/SCR/register/process.php on line 140



I'm relatively new to PHP and am unable to solve the problem so I wondered
if someone would mind spending a couple of minutes to help me.

My script, in part, reads as below:

 // check to see if company exists in db

$CompanyQuery = mysql_query(SELECT coid FROM co_details WHERE co_name =
'$company' AND co_city = '$city' AND co_country = '$co_country');

$CompanyExist = mysql_num_rows($CompanyQuery);
$company_id= mysql_result($CompanyQuery,0,0);

if ($CompanyExist  0) {

  //if company exists add workplace details
   $confirmkey =  md5(uniqid(rand()));
  $signup_id = signup_details($username, $title, $fname, $lname, $email,
$country, $job_title, $user_notes, $agree_terms, $confirmkey,$password);
  addworkplace($signup_id, $company_id, $department, $start_month,
$start_year, $end_month, $end_year );
  add_cons_info($signup_id,$functional,$technical,$mysap,$industry);

}  //END if statement

else { //add company and workplace details

   // Add new member to table signup
$confirmkey =  md5(uniqid(rand()));
   $signup_id = signup_details($username, $title, $fname, $lname,
$email, $country, $job_title, $user_notes, $agree_terms, $confirmkey,
$password);
  $company_id = company_details($company, $city, $co_country);
  addworkplace($signup_id, $company_id, $department, $start_month,
$start_year, $end_month, $end_year );
  add_cons_info($signup_id,$functional,$technical,$mysap,$industry);

 } // END else statement

  }

  //  if successful in adding to vAuthenticate, send confirmation email
  if (mysql_errno() == 0){

   $emailerMessage .= \n\n; // 2 Line Breaks
   $emailerMessage .= $confirm; // URL to confirm.php - see email.inc
   $emailerMessage .= ?confirmkey= . $confirmkey; // add confirm key to
message
   $emailerMessage .= \n\n; // 2 Line Breaks
   $sent = @mail($email, $emailerSubject, $emailerMessage,
From:$emailerName$emailerEmail\nReply-to:$emailerEmail);
 } // END if statement

}




function signup_details($username, $title, $fname, $lname, $email, $country,
$job_title, $user_notes, $agree_terms, $confirmkey, $password)  {

if ($user_notes == '') {

 $user_notes = Member chose not to include a profile;
 $sql = INSERT INTO signup VALUES
('','$username','$title','$fname','$lname','$email','$country','$job_title',
'$user_notes','$agree_terms',NOW(),'$confirmkey');
  $addmember = mysql_query($sql);
  $memberid=mysql_insert_id();

  // If SUCCESSFUL, add to vAuthenticate tables too
  if (mysql_errno() == 0){
  $AddToAuth = new auth();
  $add =
$AddToAuth-add_user($username,$password,Ungrouped,999,inactive, '',
0);
  }
  else{
print this is the signup details sql statement\n ;
print $sql.\n;
print mysql_errno() . :  . mysql_error() . \n;
exit;
  }
  return $memberid;

 }// END if

else {

  $user_notes = addslashes($user_notes);

  $sql = INSERT INTO signup VALUES
('','$username','$title','$fname','$lname','$email','$country','$job_title',
'$user_notes','$agree_terms',NOW(),'$confirmkey');
  $addmember = mysql_query($sql);
  $memberid=mysql_insert_id();

  // If SUCCESSFUL, add to vAuthenticate tables too
  if (mysql_errno() == 0){
  $AddToAuth = new auth();
  $add =
$AddToAuth-add_user($username,$password,Ungrouped,999,inactive, '',
0);
  }
  else{
print this is the signup details sql statement\n ;
print $sql.\n;
print mysql_errno() . :  . mysql_error() . \n;
exit;
  }
  return $memberid;
  }// END else

} // END function

function company_details($company, $city, $co_country)
{
  $newcompanysql = INSERT INTO co_details VALUES
('','$company','$city','$co_country');
  $add_company= mysql_query($newcompanysql);
  if (mysql_errno()  0){
print add compnay details \n;
print $newcompanysql. \n;
print mysql_errno() . : .mysql_error() . \n;
exit;
  }
  else
return mysql_insert_id();
}



function addworkplace ($signup_id, $company_id, $department, $start_month,
$start_year, $end_month, $end_year)
{
 //start date in correct format
 $start_date= $start_year.-.$start_month.-01;

  //end date in correct format
   $end_date = $end_year.-.$end_month.-01;

/* if ($end_month || $end_year == Present)
$end_date=NULL;
  else
$end_date=$end_year.-.$end_month.-01;
*/

  $worksql = INSERT INTO workplace VALUES
('','$signup_id','$company_id','$end_date','$start_date','$department');
  mysql_query($worksql);
  // need to meddle with date to get correct format
  if 

RE: [PHP-DB] Re: Mail problem

2002-10-03 Thread Snijders, Mark

I also have such a script, but i use perl, but there are no difference..

use a for or while loop

and put a sleep() function or another function in the loop.. so the server
has more time to process the mail, and there will be no timeout anymore


Mark SNijders



-Original Message-
From: Mak [mailto:[EMAIL PROTECTED]]
Sent: woensdag 2 oktober 2002 16:48
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Mail problem


Beware though...if there are too many addresses in the db, you may encounter
timeouts, or your browser may crash (very likely). Increase the timeout
before you do such a mass-mail job.

Also, my comment: If you do not want your receivers to find out who else you
sent the mail to, don't use the CC method. Just:

for(until max. users reached){
send out new mail to current user
}

Yours sincerely,
Mak

Jj Harrison\ [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  maybe use a for loop and mail command.
  should work

 Or put all the addresses in a CC/BCC field maybe sending every 100 emails
to
 prevent a mail overload/blockage due to to many recipients etc.

 Hint: look here: http://www.php.net/manual/en/language.variables.php and
you
 can find a way to append more to an existing variable. Very useful in your
 case.


 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com

  Unknown Sender [EMAIL PROTECTED] wrote in message
  002701c23924$da9b1e40$539f4dd5@administrator">news:002701c23924$da9b1e40$539f4dd5@administrator...
  Sorry to be a little bit off topic.
 
  I need a tool or script in PHP, that will automaticaly send e-mails to
  receipients taken from database.
  For example 1 the same e-mail to 1000 receipients. B
 
  Mail server is on different machine.
 
  Thanks in advance
 
 
 





-- 
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] deleting a file

2002-10-03 Thread Snijders, Mark

first try to search more on php.net


and for this time: use unlink();



-Original Message-
From: Karel [mailto:[EMAIL PROTECTED]]
Sent: donderdag 3 oktober 2002 14:16
To: [EMAIL PROTECTED]
Subject: [PHP-DB] deleting a file


hi how do i delete a file from server using php?

thanks

karel

-- 
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] Table question....

2002-10-03 Thread Snijders, Mark

you have to make it yourself...

make a counter, for every row do $counter++;

and the

if ($counter%2==0){
blue

}else{
red
}


the % is the difference math function... you got a rest-value or not...

hope you get it :)

-Original Message-
From: Rodrigo [mailto:[EMAIL PROTECTED]]
Sent: donderdag 3 oktober 2002 14:30
To: PHP
Subject: [PHP-DB] Table question


Hi people, is there a way to print a table with the background switching
colors??? like one blue, the next black, blue, black...

thanks in advance...  Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 



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