[PHP-DB] Compare columns

2006-10-19 Thread Peppe
Hi guys,
I really need some help.
I have two tables tbl_question with 2 columns question_id , question_name
and
tbl_answers with 3 columns answer_id,answer_name and questionFK.
I want to get values from question_id and compare them with questionFK if
some values are missing in questionFK then I need a insert of missing
values.
values from questionFK have to be always same as question_id
Thanx in advance

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



[PHP-DB] delete multiple query

2004-11-29 Thread peppe

Hi guys ,
Maybe this question was posted earlier but I could not find it
I have couple of tables
tblCountry
tblCity
tblStreet
tblUser
I have foreign keys
tblUser.street_FK = tblStreet.street_id
tblStreet.city_FK = tblCity.city_id
tblCity.country_FK = tblCountry.country_id
I have PHP Version 4.3.2 and MySql 3.23.49
I need when I delete country a want to delete cities under that country
streets under that city and users under streets
thanx

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



[PHP-DB] how to find

2004-11-11 Thread peppe
Hi ,
I have numbers in my array
0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
or
 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
or
 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
how can I find the first 1 and the last is there a function for it
Regards

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



Re: [PHP-DB] how to find

2004-11-11 Thread peppe
I really don't understand why people like you respond on questions do you
want to make yourself interesting . I'm new to php and I'm trying to learn
something that's why I mail in newsgroup but please please do not insult and
do not respond any more if you think people are asking stupid questions

"-{ Rene Brehmer }-" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 1. learn the basics of arrays
> 2. RTFM
>
> At 12:27 11-11-2004, peppe wrote:
> >Hi ,
> >I have numbers in my array
> >0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
> >or
> >  0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
> >or
> >  1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
> >how can I find the first 1 and the last is there a function for it

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



[PHP-DB] search query

2004-09-15 Thread peppe
Hi
I have a option box with values

Less than 150.000
tot 175.000
tot 200.000
tot 250.000
tot 300.000
tot 350.000
tot 400.000
More than 400.000

I need help when the user chose option value 3 till 200.000 than the query
should search between 175.000 and 200.000 how to achive this
Regards

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



Re: [PHP-DB] how to show this querry

2004-09-06 Thread peppe
Hi Balwant your answer helpd me only I have a problem showing the projects
starting 06-05-2004 and ending 09-09-2005 I need to show also those projects
beacuse of end date is 2005

"Balwantsingh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> try this
> SELECT start_date, end_date, project_title from tablename where
> month(start_date)=09 and year(start_date)=04
>
> this will show only the data pertaining to 09 month and 04 year.
>
> hope this will resolve your problem.
>
> with best wishes
> balwant
>
> -Original Message-
> From: peppe [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 06, 2004 2:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] how to show this querry
>
>
>  Hi ,
> I have a problem with showing a query I have a table project with start
date
> end date and project title
> I want to show only the projects that they are given in table for that
> month, for example project that starts 06-09-04 and ends 09-09-04 or ends
> 12-02-05
> but nt the projects that starts 06-10-04
>
> Any help will be appreciated
>
> --
> 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-DB] how to show this querry

2004-09-06 Thread peppe
 Hi ,
I have a problem with showing a query I have a table project with start date
end date and project title
I want to show only the projects that they are given in table for that
month, for example project that starts 06-09-04 and ends 09-09-04 or ends
12-02-05
but nt the projects that starts 06-10-04

Any help will be appreciated

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



Re: [PHP-DB] SELECT

2004-03-04 Thread peppe
Sorry my foult I don't need to compare you are right
Thank you very much

"Ignatius Reilly" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ??
> Didn't you say that $access[1] contains sets such as "1,2,3,4,7,8"?
> Why compare it to "2"?
>
> _____
> - Original Message - 
> From: "peppe" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 04, 2004 13:22
> Subject: Re: [PHP-DB] SELECT
>
>
> > Hi
> > I made this query
> > $sql= "SELECT * FROM users WHERE FIND_IN_SET( 2, access ) > 0 ";
> > $result   = mysql_query($sql);
> > $numRows  = mysql_num_rows($result);
> >
> > for ($row =1; $row <= $numRows; $row++) {
> >   $rowArray = mysql_fetch_array($result);
> > $access1   = $rowArray[1];
> >
> > if ($access1 =='2'){
> > echo "Access is 2 ";
> > } else {
> > echo "acces is not 2";
> > }
> > }
> >
> > I get always access not 2 how can I make this If works
> > "Ignatius Reilly" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > SELECT
> > > ...
> > > FROM users
> > > WHERE FIND_IN_SET( 2, values ) > 0
> > >
> > > Ignatius
> > > _
> > > - Original Message -
> > > From: "peppe" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Thursday, March 04, 2004 12:28
> > > Subject: [PHP-DB] SELECT
> > >
> > >
> > > > Hi I have a  table users with columns name email and access
> > > > In email I have values [EMAIL PROTECTED] etc in access I have values
> > > 1,2,3,4,7,8
> > > > How can I filter value 2 ?
> > > > Beacause I need only users with value 2 to send email
> > > > Greetings
> > > >
> > > > --
> > > > 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] SELECT

2004-03-04 Thread peppe
Hi
I made this query
$sql= "SELECT * FROM users WHERE FIND_IN_SET( 2, access ) > 0 ";
$result   = mysql_query($sql);
$numRows  = mysql_num_rows($result);

for ($row =1; $row <= $numRows; $row++) {
  $rowArray = mysql_fetch_array($result);
$access1   = $rowArray[1];

if ($access1 =='2'){
echo "Access is 2 ";
} else {
echo "acces is not 2";
}
}

I get always access not 2 how can I make this If works
"Ignatius Reilly" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> SELECT
> ...
> FROM users
> WHERE FIND_IN_SET( 2, values ) > 0
>
> Ignatius
> _
> - Original Message -
> From: "peppe" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 04, 2004 12:28
> Subject: [PHP-DB] SELECT
>
>
> > Hi I have a  table users with columns name email and access
> > In email I have values [EMAIL PROTECTED] etc in access I have values
> 1,2,3,4,7,8
> > How can I filter value 2 ?
> > Beacause I need only users with value 2 to send email
> > Greetings
> >
> > --
> > 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] SELECT

2004-03-04 Thread peppe
The problem is in access values are like string 1,2,3,4,5
"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello peppe,
>
> Thursday, March 4, 2004, 11:28:30 AM, you wrote:
>
> p> Hi I have a  table users with columns name email and access
> p> In email I have values [EMAIL PROTECTED] etc in access I have values
1,2,3,4,7,8
> p> How can I filter value 2 ?
> p> Beacause I need only users with value 2 to send email
>
> SELECT * FROM users WHERE access=2
>
> -- 
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html

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



[PHP-DB] SELECT

2004-03-04 Thread peppe
Hi I have a  table users with columns name email and access
In email I have values [EMAIL PROTECTED] etc in access I have values 1,2,3,4,7,8
How can I filter value 2 ?
Beacause I need only users with value 2 to send email
Greetings

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



[PHP-DB] array months

2004-02-25 Thread peppe
Hi I realy need help hier
I have a aaray of months
$lang['months'] = array
( 1 => "Januari", 2 => "Februari", 3 => "Maart", 4 => "April", 5 => "Mei",
6 => "Juni", 7 => "Juli", 8 => "Augustus", 9 => "September", 10 =>
"Oktober",
11 => "November", 12 => "December"
);
and a function
function showMonths2($montharray)
{

$maand = sprintf("%d", date("m"));
$jaar = date("Y");

for ($inx=$maand; $inx<=12; $inx++)
echo "$montharray[$inx]
  ";

$jaar++;
for ($inx=0; $inx<$maand; $inx++)
echo "$montharray[$inx]
 ";
}

The result is starts from Februari Maart .. .. December and then Januari
2005 the problem is when I click Januari 2005 I want to show months from
Januari 2005 till December 2005 and so on

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



[PHP-DB] Query

2004-02-24 Thread peppe
Hi I have this query
$sql = "SELECT * FROM events WHERE ( YEAR(datum) = '" . $year . "') ORDER BY
datum ASC";
  $result = mysql_query($sql);
  $numRows  = mysql_num_rows($result);
for ($row = 1; $row <= $numRows; $row++) {

$rowArray = mysql_fetch_array($result);
$datum= $rowArray["datum"];
$title   =$rowArray["title"];
$datum= date("d-m-Y", strtotime($datum));
$datum is 20-02-2004
?>
I want to show here the events by month for example table with events of
02(February) then if there are events from 03(March) another table and so
one
How can I make this work do I need to make another query
Any idea

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



[PHP-DB] Re: array

2003-12-11 Thread peppe
Hi
Pete I forgot to write that $acces is a field from Db and there are values
1,2,3,4
a need to split those values to make that IF
Brettking I think that is solution

"Peppe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
> I have a variable cold $access and there are values 1,2,3,4,5
> How can I check for example
> If ($access =='2'){
> echo "go further";
> }
> How can I make this work
> Thanx in advance

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



Re: [PHP-DB] array

2003-12-11 Thread peppe
Hi
Pete I forgot to write that $acces is a field from Db and there are values
1,2,3,4
a need to split those values to make that IF
Brettking thanx mate I think that is a solution


"Brettking" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi
>
> From what I can work out you need to use a function called
> in_array(value,array);
> http://www.php.net/manual/en/function.in-array.php here is the php manual
> link
>
> Hope this is what you want
> Brett
> -Original Message-
> From: peppe [mailto:[EMAIL PROTECTED]
> Sent: 11 December 2003 16:07
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] array
>
>
> Hi
> I have a variable cold $access and there are values 1,2,3,4,5
> How can I check for example
> If ($access =='2'){
> echo "go further";
> }
> How can I make this work
> Thanx in advance
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> Email has been scanned for viruses by www.emf-systems.com

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



[PHP-DB] array

2003-12-11 Thread peppe
Hi
I have a variable cold $access and there are values 1,2,3,4,5
How can I check for example
If ($access =='2'){
echo "go further";
}
How can I make this work
Thanx in advance

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