Re: [PHP-DB] evaluate file type

2002-02-25 Thread Bas Jobsen

> I create a
> list with readdir so i can show a list of files that user can download.
you already have the filename?



Op maandag 25 februari 2002 10:22, schreef Nautilis:
> Hi everybody
>
> I am wondering if there is any way to evaluate which kind of file i have on
> my server.
>
> Explanation:
>
> I have a website where i upload some files for my registered users. I
> upload every file to a certain folder. Every user has his own folder so i
> upload some files to some users and some other to other users. I create a
> list with readdir so i can show a list of files that user can download.
>
> What I am trying to do is to evaluate the extension of that file so i can
> show an icon, at least for certain types, for example PDF, GIF, JPG. ZIP
> and WORD documents, and a general icon for the rest of file extensions.
>
> Anybody can point me into the right direction for evaluate this?
>
> Thx alot in advance to anybody reading this post.
>
> Nautilis

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




Re: [PHP-DB] I'm really stuck!

2002-02-28 Thread Bas Jobsen

if($id) {
$id = $pet;

you first check for $id and then set it? 

> while(list($pet)=
> mysql_fetch_row($ret))
> print("your pet id is $pet");
>
> So if $pet will print the id from the wt_users (has a value of 3) and I
> assign $id = $pet (id also has a value of 3 in image_data)  why doesn't it
> show the image?
>
> if($id) {

if you want it for every row, there are missing { } with the while statement.

Op vrijdag 01 maart 2002 01:40, schreef Jennifer Downey:
> Hi all,
>
> I'm really stuck and I'm not asking anyone to re-write this just show me
> what is wrong, or explain why it wont work. It just seems logical that this
> should work.
>
> The first query will print the pet id in the browser.
>
> $query="SELECT  id FROM wt_users WHERE uid={$session["uid"]}";
> $ret = mysql_query($query);
> while(list($pet)=
> mysql_fetch_row($ret))
> print("your pet id is $pet");
>
> So if $pet will print the id from the wt_users (has a value of 3) and I
> assign $id = $pet (id also has a value of 3 in image_data)  why doesn't it
> show the image?
>
> if($id) {
>
>
> $id = $pet;
> $query = "select bin_data,filetype from image_data where id=$id";
>
>   $result = mysql_query($query);
>
> $data = mysql_query($result,0,"bin_data");
> $type = mysql_query($result,0,"filetype");
>
> Header( "Content-type: $type");
> echo $data;
>
> };
> echo "";
>
> Thanks
> Jennifer Downey

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




Re: [PHP-DB] GREATEST, LEAST

2002-03-11 Thread Bas Jobsen

>I want to look through the last 15 records 
ORDER BY ?? LIMIT 0,15

>d find the highest and/or
> lowest number

SELECT MAX(field),MIN(field)

Op dinsdag 12 maart 2002 03:19, schreef u:
> Could anyone give me an example of how to use GREATEST
> and LEAST in a MySQL query. I want to look through the
> last 15 records in a certain field and find the highest and/or
> lowest number. Thanks.
> Jeff Oien



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




[PHP-DB] Re: [PHP] Auto Increment Problems....

2002-07-29 Thread Bas Jobsen

Op dinsdag 30 juli 2002 05:44, schreef Georgie Casey:
> So I've 2 questions
INSERT TABLE id values('');
leave it empty
> 1) Can the next auto_increment value be 'set' by a SQL query

> 2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in the ID
> column??
I don't think so. You can mark the row, when you delete it.
Make the field mark (or you a field you already have) b.e small int (1)
In stead of deleting, you insert empty values and set mark to 1

If you insert a row, you need a extra query:
SELECT id where mark=1 SORT BY id ASC
If no row found insert with id (see above) else use the  id found;
UPDATE TABLE SET i mark='0'. WHERE id='$first_ID_with_mark_is_1'

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




Re: [PHP-DB] regarding date

2002-08-18 Thread Bas Jobsen




Op zondag 18 augustus 2002 09:53, schreef Smita Manohar:
> hii
> i'm using php with my sql. i wanted to take date input in the dd-mm-yy
> format from user. is there any function to convert this accepted input into
> -mm-dd format to store in database ?
>
> thnx and regards
>
>
>
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com

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




Re: [PHP-DB] A Doubt

2002-08-28 Thread Bas Jobsen

Hi,

>   The reason is, I need to check everytime the file "abcd.php"
> is
> loaded, I should be able to determine that it was loaded by
> "mnop.php"

If you include abcd.php in mnop.php
$_SERVER['SCRIPT_NAME'] equals /mnop.php for both scripts.

So you can test in abcd.php for this.

 





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




Re: [PHP-DB] A Doubt

2002-08-28 Thread Bas Jobsen

Hi Manoj,

Your reply adrress seems to be wrong:
- The following addresses had permanent fatal errors -
<[EMAIL PROTECTED]>
(reason: 553 sorry, your envelope sender is in my badmailfrom list 
(#5.7.1))

   - Transcript of session follows -
... while talking to mail3.rediffmail.com.:
>>> RCPT To:<[EMAIL PROTECTED]>

<<< 553 sorry, your envelope sender is in my badmailfrom list (#5.7.1)
550 5.1.1 <[EMAIL PROTECTED]>... User unknown

try out this

main.php:


include.php:


Now run include.php directly outputted is: /include.php
run main.php outputted is: /main.php

Hope that helps?

so in include.php, you can say:

if($_SERVER['SCRIPT_NAME']!='/main.php') {echo 'forbidden to call the script 
direcly'; exit;}
 

Op woensdag 28 augustus 2002 22:26, schreef u:
> hi bas,
>   I am sorry but I could not follow what you meant by saying
> include
> abcd.php. I am a bit new to PHP and so I am bit slow to grasp
> the
> concepts. If I am not wrong, I understand that if by including a
> file
> the whole file is displayed in addition to the main file, i.e. if
> I
> include abcd.php in mnop.php the output would be mnop.php plus the
> the
> output of abcd.php, right?
>
> And could you explain what  "$_SERVER['SCRIPT_NAME'] equals
> /mnop.php
> for both scripts." means.
>
> Thanks for your help and patience. I appreciate that.
>
> Best Regards,
>
> Manoj.

Op woensdag 28 augustus 2002 17:44, schreef Manoj Japher:
> hi,
>I have a question. Hoping someone may help me out.
>
>   Can a PHP page say file "abcd.php" access a variable $xyz which
> is
> used in another file "mnop.php"? I mean can I refer to a
> variable
> whose value has been set in some other file.
>   The point is that the file "mnop.php" after finishing its query
> and
> on a particular case loads "abcd.php".
>
>   The reason is, I need to check everytime the file "abcd.php"
> is
> loaded, I should be able to determine that it was loaded by
> "mnop.php"
> and not by typing in the complete URL to "abcd.php" on the Web
> Browser.
>
> Hoping someone could tell me how if it is possible
>
> Best Regards,
>
> Manoj
>
>
> 'I have miles to go before I sleep, and promises to keep'

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




Re: [PHP-DB] A Doubt

2002-08-28 Thread Bas Jobsen




Hi Manoj,

>   echo " document.location = 'include.php'  ";


I think i could also use:
header('Location: include.php');
// you shouldn't print anything else before the header

Now your flag thing.
I the first place you could check
$_SERVER['HTTP_REFERRER']
gives you the page the user came from.

A other thing you could do is:
1) make een unique key ($key=md5(uniqid(rand(),1));)
2a) put that key in a session
--
session_start();
$_SESSION['key']=$key;
--
2b)give it througt as flag
header('Location: include.php?key='.$key);

3) Now you can do the check in your include:
--
session_start();
if($_SESSION['key']!=$_GET[key]) {echo 'forbidden to call
the  script direcly'; exit;}
--

This is saver the the referrer check but still not 100% proof.

The savest way is to put all in one file.

I will give you an example: Show the secret to evryone who filled in  Manoj

--

 
 
 Secret information in plain html
 
 
 




username: 




--

Notice: I haven't checked the code above.
You can put the html in the else clause in an seperated file and use
the script_name check discussed before.

Best regards,

Bas

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




Re: [PHP-DB] randomizing amounts of html displayed

2002-09-12 Thread Bas Jobsen



Op donderdag 12 september 2002 20:58, schreef Aaron Wolski:
> Hi All..
>
> Quick question and perhaps a suggestion/solution requst to the above
> topic. My brain is just not working :(
>
>
> I have a HTML table with 5 rows of data. I would like to randomly
> display 3 of the 5 rows when the page is accessed.
>
>
> For example:
>
>
>
>
>
> Row 1
>
>
> Row 2
>
> Row 3
>
> Row 4
>
> Row 5
>
>
> When the page is loaded only Row 1,2 and 4 are displayed. When someone
> else loads the page rows 2,4 and 5 are displayed.
>
> Any clues on how to make this possible??
>
> Thanks in advance for looking.
>
> Peace.
>
> Aaron

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




Re: [PHP-DB] Separating content from style

2002-10-09 Thread Bas Jobsen

Op woensdag 09 oktober 2002 18:29, schreef u:
> One of the most popular template engines is Smarty. Search on google for
> it. 
http://smarty.php.net/

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




[PHP-DB] (reverse) matching like LIKE?

2002-10-14 Thread Bas Jobsen

Hi,

When if have the keyword 'msq' i can match the field 'mysqldata'
SELECT * FROM table WHERE field LIKE "$keyword%"
But how do i get a match when the keyword is 'mysqldatabase' and the field 
'mysql'? (TRUE cause keyword contains 'mysql').

Thanks,

Bas

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




Re: [PHP-DB] upload script filename checking

2002-10-14 Thread Bas Jobsen

Op maandag 14 oktober 2002 15:41, schreef Michael Knauf/Niles:
> (because of the space)... so I want to replace any occurrence of " " with "
> _"
$filename=str_replace(' ','_',$filename);

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




Re: [PHP-DB] Parsing Error

2001-09-05 Thread Bas Jobsen

Maybe rename your page to loose.php


-- 
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] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?

2001-09-05 Thread Bas Jobsen

Hello,

Maybe someone can tell me, the difference

b.e.
$result = mysql_query ($query);
unset($result);
#or better mysql_free_result($result); 

tnx,

Bas Jobsen



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

2001-09-05 Thread Bas Jobsen

> Hello,
> Here is the code I have:

sure, your query is something like:
select ..., store,  jobdesc .. FROM ..

why using:
>$store=$row["store"];
>$jobdesc=$row["jobdesc"];
echo"dhdhdh".$row["store"]."blabla" would also work

i should use:
while (LIST($store,$jobdesc)=mysql_fetch_row($result)) {
.

- Original Message - 
From: "Jeff Grossman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 11:50 PM
Subject: [PHP-DB] Forms Question


> Hello,
> Here is the code I have:
> 
> while ($row=mysql_fetch_array($result)) {
>$store=$row["store"];
>$jobdesc=$row["jobdesc"];
> echo "";
> echo "Store:
>   
>  Signal Hill
>  Reseda
>  Orange
>  West Covina
>  Riverside
>  Norwalk
>  Fountain Valley
>  Pasadena
>  Redondo Beach
>  San Bernardino
>  Kearny Mesa
>  San Marcos
>  Chino
>  Corporate Office
>   ";
> echo " VALUE=\"$jobdesc\">";
> echo " Changes\">";
> }
> 
> 
> Is want I am trying to do possible?  I want the value which is stored in 
> $store to automatically fill in on the drop down list.  But, for some 
> reason it is defaulting to the first option, and not using the value 
> that is in the database.
> 
> Can I use a drop down menu, or should I just go to radio buttons?
> 
> Thanks,
> Jeff
> 
> -- 
> Jeff Grossman ([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] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?

2001-09-05 Thread Bas Jobsen

Hello,

> unset() simply deletes the pointer to the data without releasing the space
> held by the data.
> mysql_free_result() releases the data storage pointed-to by the $result
> pointer.
> This is important because $result could be pointing-to a dataspace
> containing a large number or rows returned by the mysql_query().  You WANT
> to recover this dataspace.

Well, oke, tnx. But if unset() doesn't releas the data-space, what then is
it's functionality?
only voor tests like: if(isset($var)) ;?

And how can i free the data-space from a string or somting like that?
b.e.
$string="a very long string";
free($string);#?
#could i use mysql_free_result($string);

Tnx,

Bas


-- 
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/PHP what is the difference between unset() and mysql_free_result() ?

2001-09-06 Thread Bas Jobsen

> And how can i free the data-space from a string or somting like that?
> b.e.
> $string="a very long string";
> free($string);#?
> #could i use mysql_free_result($string);

Maybe I can  use: unset($string="");
or unset($array=array()); to free the data-space also




-- 
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] SQL combine to summations queries?

2001-09-06 Thread Bas Jobsen

Hello,

I don't understand the following, who can help?

I have got two queries:
SELECT SUM(fielda) FROM table1
and
SELECT SUM(fieldb) FROM table2

I thought this would be the same as:
SELECT SUM(fielda.table1),SUM(fieldb.table2)   FROM table1, table2.
But, itn't, why?

Tnx,

Bas Jobsen


-- 
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] SQL combine to summations queries?

2001-09-06 Thread Bas Jobsen


> To do what I think you are trying to do you would use something like:
> Select sum(table1.fielda),sum(table2.fieldb) from table1 LEFT JOIN table2
ON
> table1.id=table2.id;

> if table1.fielda has more rows.
> If table2.fieldb has more rows use:
 the amount of rows is the same :)

> Select sum(table1.fielda),sum(table2.fieldb) from table2 LEFT JOIN table1
ON
> table1.id=table2.id;
>
> Hope that helps

Yes, it does, TNX!!!



-- 
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] currency out of postgresql

2001-09-14 Thread Bas Jobsen

> $formatted = sprintf("%01.2f", $money);
> printf ("%01.2f\n", $formatted);

maybe twice, try:
$formatted = sprintf("%01.2f", $money);
echo "$formatted\n";


- Original Message -
From: "Rick Eicher II" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 6:48 PM
Subject: [PHP-DB] currency out of postgresql


> I am trying to get two currency values from out of the database, add them
> together and print the to the screen. I am using the following code.
>
> $money = $myrow[6] + $myrow[7];
> $formatted = sprintf("%01.2f", $money);
> printf ("%01.2f\n", $formatted);
>
> $myrow[] is the array that I load the database records into.
>
> I can echo $myrow[6] & $myrow[7], which will show like $4.00 and $4000.00.
> But when I add them together the come out as 0 every time. The columns in
> the database are of type money. This is a postgresql database.
>
> Does any one see the errors of my ways?
>
> thanks,
> Rick Eicher II
> www.pbol.net
>
>
> --
> 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] include_path

2001-09-17 Thread Bas Jobsen

place connect.php in teh same dir as confirmregistration.php (/mall/)
- Original Message -
From: "its me" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 12:50 AM
Subject: [PHP-DB] include_path


> Fatal error: Failed opening required 'connect.php'
(include_path='.:/usr/local/lib/php') in
/home/sites/site92/web/mall/confirmregistration.php on line 3
>
>
> and
>
>
> Fatal error: Failed opening required 'connect.php' (include_path='') in
/home/sites/site92/web/mall/confirmregistration.php on line 3
>
>
> and my script  is:
>
>  session_start();
> require("connect.php");
> ?>
>
>
>
> so?
>
>
>
> 
> 
>
> --
> 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] MYSQL/PHP what is the difference between unset() and mysql_free_result() ? II

2001-09-18 Thread Bas Jobsen

> > unset() simply deletes the pointer to the data without releasing the
space
> > held by the data.
> > mysql_free_result() releases the data storage pointed-to by the $result
> > pointer.
> > This is important because $result could be pointing-to a dataspace
> > containing a large number or rows returned by the mysql_query().  You
WANT
> > to recover this dataspace.

What about an overwrite? Will this also overwrite the dataspace?
b.e.:
$result=mysql_query($query1);
mysql_free_result($result);
$result=mysql_query($query2);
mysql_free_result($result);

Does the first  mysql_free_result make any sense here?

Tnx,

Bas Jobsen




-- 
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] Howto make a double LEFT JOIN

2001-10-02 Thread Bas Jobsen

Hello,

How can i make a double LEFT JOIN?

Now i have got:

SELECT table1.id FROM table1 LEFT JOIN (table2 LEFT JOIN table3 ON
table2.id=table3.id) ON table1.id=table2.id

but this gives an error

Tnx,

Bas


-- 
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] Howto make a double LEFT JOIN

2001-10-02 Thread Bas Jobsen

> Remove the parentheses
> SELECT table1.id FROM table1 LEFT JOIN table2 LEFT JOIN table3 ON
> table2.id=table3.id ON table1.id=table2.id

I still got:
MySQL retourneerde: You have an error in your SQL syntax near 'LEFT JOIN
table3 ON
table2.id=table3.id ON table1.id=table2.id' at line 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]




Re: [PHP-DB] Howto make a double LEFT JOIN

2001-10-02 Thread Bas Jobsen

> SELECT table1.id FROM table1 LEFT JOIN table2 ON table1.id=table2.id LEFT
> JOIN table3 ON table2.id=table3.id

Well, oke now i have:
table1:
id|no
1|1
2|1

table2:
id|no
1|1
1||1

table2:
id|no
1|1
1||1
1||1

The result i want tot have is:
id|sum(table2.no)|sum(table3.no)|
1|2|3
2|0|0
my query:

SELECT DISTINT( table1.id) AS test, SUM(table2.no) AS tot, SUM(table3.no
FROM table1 LEFT JOIN table2 ON table1.id=table2.id LEFT JOIN table3 ON
table2.id=table3.id GROUP BY test ORDER BY tot DESC

which give my something like:
id|5|5|
1|2|3
2|0|0
:(






- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Bas Jobsen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 10:19 PM
Subject: RE: [PHP-DB] Howto make a double LEFT JOIN


> SELECT table1.id FROM table1 LEFT JOIN table2 ON table1.id=table2.id LEFT
> JOIN table3 ON table2.id=table3.id
>
> -Original Message-
> From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 02, 2001 3:13 PM
> To: Rick Emery; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Howto make a double LEFT JOIN
>
>
> > Remove the parentheses
> > SELECT table1.id FROM table1 LEFT JOIN table2 LEFT JOIN table3 ON
> > table2.id=table3.id ON table1.id=table2.id
>
> I still got:
> MySQL retourneerde: You have an error in your SQL syntax near 'LEFT JOIN
> table3 ON
> table2.id=table3.id ON table1.id=table2.id' at line 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] Howto make a double LEFT JOIN

2001-10-02 Thread Bas Jobsen

Hi Rick,

> please show the REAL output from your query and what it should REALLY look
> like

 table1:
 id|no
1|1
2|1

table2:
id|no
1|1
1|1

 table3:
id|no
1|1
1|1
1|1

using:
SELECT DISTINCT(table1.id) AS test, SUM(table2.no) AS tot, SUM(table3.no)
FROM table1 LEFT JOIN table2 ON table1.id=table2.id LEFT JOIN table3 ON
table2.id=table3.id GROUP BY test ORDER BY tot DESC

gives:
test|tot|SUM(table3.no)
1|6|6
2|0|0

and i want to have:
test|tot|SUM(table3.no)
1|2|3
2|0|0

Tnx,

Bas






- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Bas Jobsen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 11:11 PM
Subject: RE: [PHP-DB] Howto make a double LEFT JOIN


> please show the REAL output from your query and what it should REALLY look
> like
>
> -Original Message-
> From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 02, 2001 3:38 PM
> To: Rick Emery; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Howto make a double LEFT JOIN
>
>
> > SELECT table1.id FROM table1 LEFT JOIN table2 ON table1.id=table2.id
LEFT
> > JOIN table3 ON table2.id=table3.id
>
> Well, oke now i have:
> table1:
> id|no
> 1|1
> 2|1
>
> table2:
> id|no
> 1|1
> 1||1
>
> table2:
> id|no
> 1|1
> 1||1
> 1||1
>
> The result i want tot have is:
> id|sum(table2.no)|sum(table3.no)|
> 1|2|3
> 2|0|0
> my query:
>
> SELECT DISTINT( table1.id) AS test, SUM(table2.no) AS tot, SUM(table3.no
> FROM table1 LEFT JOIN table2 ON table1.id=table2.id LEFT JOIN table3 ON
> table2.id=table3.id GROUP BY test ORDER BY tot DESC
>
> which give my something like:
> id|5|5|
> 1|2|3
> 2|0|0
> :(
>
>
>
>
>
>
> - Original Message -
> From: "Rick Emery" <[EMAIL PROTECTED]>
> To: "'Bas Jobsen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, October 02, 2001 10:19 PM
> Subject: RE: [PHP-DB] Howto make a double LEFT JOIN
>
>
> > SELECT table1.id FROM table1 LEFT JOIN table2 ON table1.id=table2.id
LEFT
> > JOIN table3 ON table2.id=table3.id
> >
> > -Original Message-
> > From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 02, 2001 3:13 PM
> > To: Rick Emery; [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] Howto make a double LEFT JOIN
> >
> >
> > > Remove the parentheses
> > > SELECT table1.id FROM table1 LEFT JOIN table2 LEFT JOIN table3 ON
> > > table2.id=table3.id ON table1.id=table2.id
> >
> > I still got:
> > MySQL retourneerde: You have an error in your SQL syntax near 'LEFT JOIN
> > table3 ON
> > table2.id=table3.id ON table1.id=table2.id' at line 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]
>


-- 
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] Howto make a double LEFT JOIN

2001-10-03 Thread Bas Jobsen

Hello Sheridan Saint-Michel,

Let's see.

Table2 contains data with a unique identifier (id)
b.e
id|url

Table1 and Table3 contain the same identifier (id) but it isn't unique now.
Table1 and Table3 contain couting of action. Cause i want to count only the
actions of the last X hours, each count is on a row apart. Each row in this
table contains a timestamp, so i could do something like "DELETE FROM Table1
WHERE time
To: "Bas Jobsen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 6:34 PM
Subject: Re: [PHP-DB] Howto make a double LEFT JOIN


> A couple of things here.  The problem you are having has nothing to do
with
> the double left join.  The problem is occuring in the left join between
> table2 and table3.  With the way you have your tables set up
>
> select table2.id as test,count(table2.no),count(table3.no) from table3
left
> join table2 ON table2.id=table3.id group by test;
>
> will give you the result set
>
> | test | count(table2.no) | count(table3.no) |
> |1 |6 |6 |
>
> Which is exactly what you are running into with the double join.  In order
> to fix this you need to rethink the way you have your tables setup.
>
> Why is id 1 for every field in table2 and table3?  The id column should be
> used to uniquely identify rows, thereby allowing you to do things like
what
> you are currently attempting.  What is the actual data that you are trying
> to represent and why are you doing it in this fashion?  Why is table1 even
a
> part of this select?
>
> If you were to change table2 and table3 so that id was a unique identifier
> like so
>
> table2
> 1 | 1
> 2 | 1
>
> table3
> 1 | 1
> 2 | 1
> 3 | 1
>
> You could get the result set you said you wanted
> 1 | 2 | 3
> with something like
>
> select table2.id as test,count(table2.no),count(table3.no) from table3
left
> join table2 ON table2.id=table3.id group by table3.no;
>
> We currently don't have enough to go on, and I think part of the problem
is
> the design of the tables themselves.  Reply with some specifics to the
> actual problem... not your proposed solution, and you will probably be
more
> likely to get help from someone on the list.
>
> Also, if you do change the id fields in table2 and table3 as I have
> suggested you can get your
> 1 | 2 | 3
> return set from all three tables using this double join
>
> select table1.id as test,count(table2.no),count(table3.no) from table3
left
> join table2 using(id) left join table1 using(id) group by table3.no;
>
> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.com
>
> - Original Message -
> From: "Bas Jobsen" <[EMAIL PROTECTED]>
> To: "Rick Emery" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, October 02, 2001 4:59 PM
> Subject: Re: [PHP-DB] Howto make a double LEFT JOIN
>
>
> > Hi Rick,
> >
> > > please show the REAL output from your query and what it should REALLY
> look
> > > like
> >
> >  table1:
> >  id|no
> > 1|1
> > 2|1
> >
> > table2:
> > id|no
> > 1|1
> > 1|1
> >
> >  table3:
> > id|no
> > 1|1
> > 1|1
> > 1|1
> >
> > using:
> > SELECT DISTINCT(table1.id) AS test, SUM(table2.no) AS tot,
SUM(table3.no)
> > FROM table1 LEFT JOIN table2 ON table1.id=table2.id LEFT JOIN table3 ON
> > table2.id=table3.id GROUP BY test ORDER BY tot DESC
> >
> > gives:
> > test|tot|SUM(table3.no)
> > 1|6|6
> > 2|0|0
> >
> > and i want to have:
> > test|tot|SUM(table3.no)
> > 1|2|3
> > 2|0|0
> >
> > Tnx,
> >
> > Bas
> >
> >
> >
> >
> >
> >
> > - Original Message -
> > From: "Rick Emery" <[EMAIL PROTECTED]>
> > To: "'Bas Jobsen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, October 02, 2001 11:11 PM
> > Subject: RE: [PHP-DB] Howto make a double LEFT JOIN
> >
> >
> > > please show the REAL output from your query and what it should REALLY
> look
> > > like
> > >
> > > -Original Message-
> > > From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, October 02, 2001 3:38 PM
> > > To: Rick Emery; [EMAIL PROTECTED]
> > > Subject: Re: [PHP-DB] Howto make a double LEFT JOIN
> > >
> > >
> > > > SELECT table1.id FROM table1 LEFT JOIN table2 ON table1.id=table2.id
> > LEFT
> > > > JOIN table3 ON table2.id=tabl

Re: [PHP-DB] Howto make a double LEFT JOIN

2001-10-04 Thread Bas Jobsen

Hello Sheridan Saint-Michel,

Well it works fine, tnx!!!

But now i want to understand it too.

bit_count(bit_or(1<999.999.999))

Now i thougth bit_count(bit_or(32<
To: "Bas Jobsen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, October 04, 2001 8:02 PM
Subject: Re: [PHP-DB] Howto make a double LEFT JOIN


> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.com
>
>
> - Original Message -
> From: "Bas Jobsen" <[EMAIL PROTECTED]>
> To: "Sheridan Saint-Michel" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, October 03, 2001 2:52 PM
> Subject: Re: [PHP-DB] Howto make a double LEFT JOIN
>
>
> > Hello Sheridan Saint-Michel,
> >
> > Let's see.
> >
> > Table2 contains data with a unique identifier (id)
> > b.e
> > id|url
> >
> > Table1 and Table3 contain the same identifier (id) but it isn't unique
> now.
> > Table1 and Table3 contain couting of action. Cause i want to count only
> the
> > actions of the last X hours, each count is on a row apart. Each row in
> this
> > table contains a timestamp, so i could do something like "DELETE FROM
> Table1
> > WHERE time identifier
> > (sid)).
> >
> > Table1 and Table3:
> > sid|id|count|time
> >
> > count is always 1
>
> You probably don't need count, as each entry implies one event, unless you
> are using
> it for something else I don't know about... otherwise this looks good.
>
> > Oke, what do i want?
> >
> > First i want to know which id's  are in Table1 and how many times (know
> not
> > all the id's from Table2 have to be in Table1(or in Table3, and not all
> the
> > id's from Table1 have to be in Table3))
> >
> > something like: "SELECT DISTINCT id, SUM(count) FROM table1 GROUP BY id"
> >
> > For each id found in Table1 i want to know two things:
> >
> > 1) the url from Table2
> > 2) is there any row in Table3 where table1.id=table3.id and if so, how
> many
> > are there?
> >
> > This is it.
> >
> > thanks!!!,
> >
> > Bas
>
> Okay, now that you have added a unique Primary Key to each table this
> becomes a doable task.  The query to do everything you list here should
be:
>
> select table1.id,bit_count(bit_or(1< count1,bit_count(bit_or(1< table1 left join table3 using(id) left join table2 using(id) group by
> table1.id;
>
> As you can see, count is never used... which is why I said you probably
> don't need it.
>
> Let me know if this helps
>
> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.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]




[PHP-DB] bitshift

2001-10-05 Thread Bas Jobsen

Hello,

bit_count(bit_or(1

Re: [PHP-DB] Howto make a double LEFT JOIN

2001-10-05 Thread Bas Jobsen

Hello,

> okay... 1< Your result will be a binary number... which will be the number 1 followed
> by table1.sid 0's.  Once you have this you do a bitwise or of all the
> numbers you have shifted.  This means any two rows where sid was the same
> will be combined, as there is no difference between (1 or 1) and (1 or 0).
> The last step, then, is to count the 1 bits and see how many different
sid's
> there were.
>
> Make Sense?  The problem before was that there was no way to differentiate
> one row from another, and thus no way to combine identical rows  =P

Oke, tnx, i understood

> ACK!  Don't do this.  You do know that an unsigned int (using a signed int
> in an auto_increment field is pointless anyway) has a max value of
> 4294967295, right?  To put this into perspective... if you had one million
> customers, they would have more than 4294 transactions EACH before sid
> filled up.  If you are still worried about running out of numbers in your
> sid field make it an unsigned bigint.  The max value for an unsigned
bigint
> is 18446744073709551615... so that should give you lots of space to play
in,

Well, oke. I'm builing some pageviewcounter.  Maybe count more then
1 million pageview a day in future :) You're right it will take many days
before i have counted 18446744073709551615 views :). But in some way it feel
like wasting. The first day using the first milion ids, the second day the
next milion and never reuse that numbers. (Yes i realize 8bytes a row is
much better then 32 (or 33 if you do stupid things :)))

Maybe there is a better implemention? I dont i the first one solving this?
--
every step i do:
1) creating a (1!) row id(unique)||time
2) deleting row(s) time and sid will only be 8 bytes per row... not 33 (Also incidentally, if you
do
> want to save an md5 value to a row in the future... use char not varchar
as
> you know it will be 32 bytes and are adding a wasted 33rd byte).

Oke, i see.

> See my explanation above.  All you are trying to do is shift a 1 digit to
a
> different place for each unique value of sid.  The above definately won't
> work if sid is an md5 value as md5 includes a-z characters.
oke.

>  Again, hope that helps  =)

I will let you know

Best regards,

Bas



-- 
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] Auto_increment field size (was: Howto make a double LEFT JOIN)

2001-10-05 Thread Bas Jobsen

Hello,

> you can always reset the auto_increment value (I think that is as simlple
as
> "set insert_id=1;" but you may want to double check as this is off the top
> of my head).

I don't think i can do so cause i never delete all rows.
 so will get something like:
1
<- new insert her
1000
1001
etc.




-- 
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] Question In French.

2001-10-18 Thread Bas Jobsen




 




-- 
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] it works but i don't uderstand

2001-10-24 Thread Bas Jobsen

Hello,

I'm building some database class, so i can reuse my code when using a not
mysql database system.

I'm implementing a free_result now;

some code of my class

class database
{

function free_result($result)
{
mysql_free_result($result);
return;
}
..
}
?>

some of the code:

include ("class_mysql.php");
$db= new database();
$db->connect();
$result=$db->select_query("SELECT * FROM users");
echo mysql_num_rows($result);
$db->free_result($result);
echo mysql_num_rows($result);

Running this will give:
2 and "Warning: 2 is not a valid MySQL result resource"
So this seems to work, but why? Why is $result handled as it is a global
var?

I should think it must be something like:

function free_result(&$result)
{
mysql_free_result($result);
return;
}

But this don't work.

Thanks,

Bas




-- 
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 Query and blank fields

2001-10-25 Thread Bas Jobsen

>I have field with value '9876' and if I do "...field=field+'5'..." the
>value turns into '9881' not '98765' as I expected.

make your field type "var char"

- Original Message -
From: "Niklas Lampén" <[EMAIL PROTECTED]>
To: "Php-DB" <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 3:03 PM
Subject: RE: [PHP-DB] mySQL Query and blank fields


Thanks a lot! I quite didn't know what to look for in the manual.

I actually have another question:
If I want to update several fields, add a number to the end of the
fields value, how do I do that?
I have field with value '9876' and if I do "...field=field+'5'..." the
value turns into '9881' not '98765' as I expected.


Niklas



-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 25. lokakuuta 2001 15:56
To: Php-DB
Subject: RE: [PHP-DB] mySQL Query and blank fields


Change that to:
SELECT * FROM foo_table WHERE length(bar_field)>1;

-Original Message-
From: Tamas Arpad [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 8:01 AM
To: Niklas Lampén; Php-DB
Subject: Re: [PHP-DB] mySQL Query and blank fields


On Thursday 25 October 2001 13:16, Niklas Lampén wrote:
> How can I query for specified fields that has to contain atleast 2
> charters?

SELECT * FROM foo_table WHERE length(bar_field)>=1;

Arpi
>
> Example:
> Field AAA contains '' (NULL) => No match
> Field BBB contains ' ' (one charter) => No match
> Field CCC contains  'ab' => Match
> Field DDD contains 'abcdefg' => Match
>
>
> Niklas

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



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


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



-- 
PHP 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] select take (too) much time

2001-10-30 Thread Bas Jobsen

hello,

i have got a table "table1":

CREATE TABLE table1
(
   id bigint(20) unsigned DEFAULT '0' NOT NULL auto_increment,
   refer varchar(255) NOT NULL,
   aantal int(9) DEFAULT '1' NOT NULL,
   time int(10) DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE id (id)
);

now i insert about 200 rows in it.

After that i do i select (using phpMyAdmin):
SELECT table1 FROM table1

it seems this never stops sending data:
SHOW processlist:
Id User Host db Command Time State Info
171807   __   Query   300   Sending data   SELECT * FROM
table1

also a delete like "DELETE FROM table1 WHERE time<." will take (too)
much time.

All this give problems cause the table is locked when 'Sending data' and the
row of new inserts is growing.

Is there something wrong with my table-design?

Thanks for reading.

Bas





-- 
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] automated processes in mysql

2001-10-30 Thread Bas Jobsen

Hello,

Can i use mysql for automated processes?
do $query every hour.

Tnx,

Bas


-- 
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] automated processes in mysql

2001-10-30 Thread Bas Jobsen

Hello,

Thank for all your soon responses. Well, oke, I know about corntab. But
someone told me myslq  can do the job itself.

Tnx again,

Bas


-- 
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 result resource error

2001-12-19 Thread Bas Jobsen


$sql = "select Minor_Category FROM main where Page = 'wines' order by
Minor_Category";


Op donderdag 20 december 2001 01:19, schreef Shannon Doyle:
> Hi People,
>
> I am getting a Not a valid Mysql result resource error with the
> following code, can someone take a look at this for me and see if there
> is anything that stands out
>
> Thanks,
>
> Shannon
>
>  $cattyname = "";
> $sql = "select Minor_Category main where Page = 'wines' order by
> Minor_Category";
> $dbh = @mysql_connect($dbhost,$dbuser,$dbpass);
> $results2 = mysql_db_query($db,$sql,$dbh);
>   for($j = 0; $j < mysql_num_rows($results2); $j++) {
>   $array[$j] = mysql_fetch_array($results2);
> }
> mysql_close($dbh);
> for ($h = 0; $h < count($array); $h++)  {
>
> if ($array[$h]["Minor_Category"] != $cattyname) {
>   $cattyname = $array[$h]["Minor_Category"];
>   echo " name='".$cattyname."'>".$cattyname."";
>
>
> $catname = "";
> $sql = "select Category,Code,Description,Pack,Unit,Price from main where
> Page = 'wines' && Minor_Category = $cattyname order by Category";
> $dbh = @mysql_connect($dbhost,$dbuser,$dbpass);
> $results = mysql_db_query($db,$sql,$dbh);
>   for($i = 0; $i < mysql_num_rows($results); $i++) {
>   $array[$i] = mysql_fetch_array($results);
> }
> mysql_close($dbh);
>
> for ($i = 0; $i < count($array); $i++)  {
>
> if ($array[$i]["Category"] != $catname) {
>   $catname = $array[$i]["Category"];
>   echo " name='".$catname."'>".$catname." align='center'>Carton Size align='center'>Unit align='right'>Price src='images/arrow.gif' border='0'>";
> }
>
>   echo " href=javascript:order_now("".$array[$i]["Code"]."")> src='images/order.gif' border='0'> align='left'>".$array[$i]["Description"]." align='center'>".$array[$i]["Pack"]." align='center'>".$array[$i]["Unit"]." align='right'>$".$array[$i]["Price"]."\n";
> }
> }
> }
> ?>

-- 
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 to write this querry?

2001-12-30 Thread Bas Jobsen



delete from cities
where cities.province_id<>provinces.province_id
Op zondag 30 december 2001 21:55, schreef Andy:
> Hi guys,
>
> I am trying to get rid of not needed data.
>
> There is a table called provinces containing country_codes and province_id
> Another table contains the cities with the field province_id
>
> How can I get rid of cities which are not listed with a province_id in the
> table provinces?
>
> I tryed something like that:
>
> delete from cities
> where NOT cities.province_id = provinces.province_id
>
> Does not work though :-(
>
> Can anybody help please?
>
> cheers Andy

-- 
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] what is the result index? (Mysql)

2002-01-14 Thread Bas Jobsen


Hello,

I'm running a select-query and getting this warning:
--
Warning: Unable to jump to row 100 on MySQL result index 2 
--
I know the reason for the warning, but what exactly does this number two mean?

The query is in een for-loop and the resultnumber rises by 2.

Best regards,

Bas

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