Re: [PHP-DB] Parse error

2009-09-24 Thread Ron Piggott
There are further problems with the mySQL query:

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near ') AND
CURDATE() = DATE(FROM_UNIXTIME(1239508800)), 1, 0), IF(CURDATE() =
DATE'

This is the whole query, what am I missing / doing wrong?

SELECT GREATEST( IF(CURDATE() =
DATE_SUB(CONCAT(DATE(FROM_UNIXTIME(1239508800)), INTERVAL LEAST(14,
(SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use
= 1)) DAY) AND CURDATE() = DATE(FROM_UNIXTIME(1239508800)), 1, 0),
IF(CURDATE() = DATE_SUB(CONCAT(YEAR(CURDATE()), '-12-25'), INTERVAL
LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE
seasonal_use = 2)) DAY) AND CURDATE() = YEAR(CURDATE()), '-12-25'), 2,
0) ) AS verse_application


On Thu, 2009-09-24 at 15:39 +1000, Chris wrote:
 Ron Piggott wrote:
  Let me try this is a different way.  
  
  What is the variable which I am able to retrieve?  I am expecting the
  result to be a 0, 1 or 2.  
 
 Your original problem was getting a parse error.
 
 Your query is not php code - step 1 is to fix that.
 
 Once you've done that, post the new code and new problem you're having.
 


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



[PHP-DB] Parse error

2009-09-23 Thread Ron Piggott
The following code gives me this error message:

Parse error: syntax error, unexpected ':'
in /home/thev4173/public_html/test.php on line 8

It is referencing the : that follows EasterDate (and will eventually get
mad at ChristmasDate)


mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( Unable to select database);

IF(CURDATE() = DATE_SUB(CONCAT(@EasterDate :=
DATE(FROM_UNIXTIME(easter_date(date('Y'))), INTERVAL LEAST(14, (SELECT
COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1))
DAYS) AND CURDATE() = @EasterDate, 1, 0)

IF(CURDATE() = DATE_SUB(CONCAT(@ChristmasDate := YEAR(CURDATE()),
'-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM
`verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAYS) AND
CURDATE() = @ChristmasDate, 2, 0)

mysql_close();



What is the problem?

And what is the variable that has the value of 0, 1 or 2?

Ron


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



Re: [PHP-DB] Parse error

2009-09-23 Thread Chris

Ron Piggott wrote:

The following code gives me this error message:

Parse error: syntax error, unexpected ':'
in /home/thev4173/public_html/test.php on line 8

It is referencing the : that follows EasterDate (and will eventually get
mad at ChristmasDate)


mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( Unable to select database);

IF(CURDATE() = DATE_SUB(CONCAT(@EasterDate :=
DATE(FROM_UNIXTIME(easter_date(date('Y'))), INTERVAL LEAST(14, (SELECT
COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1))
DAYS) AND CURDATE() = @EasterDate, 1, 0)

IF(CURDATE() = DATE_SUB(CONCAT(@ChristmasDate := YEAR(CURDATE()),
'-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM
`verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAYS) AND
CURDATE() = @ChristmasDate, 2, 0)

mysql_close();



What is the problem?


If this is your actual code, the queries aren't in php variables.

$query = IF(curdate()  ;

--
Postgresql  php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] Parse error

2009-09-23 Thread Chris

Ron Piggott wrote:

This is the actual code.  What should I have?


Same as when you do a query normally.

$query = SELECT ... WHERE ;

$result = mysql_query($query);

.


On Thu, 2009-09-24 at 13:20 +1000, Chris wrote:

Ron Piggott wrote:

The following code gives me this error message:

Parse error: syntax error, unexpected ':'
in /home/thev4173/public_html/test.php on line 8

It is referencing the : that follows EasterDate (and will eventually get
mad at ChristmasDate)


mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( Unable to select database);

IF(CURDATE() = DATE_SUB(CONCAT(@EasterDate :=
DATE(FROM_UNIXTIME(easter_date(date('Y'))), INTERVAL LEAST(14, (SELECT
COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1))
DAYS) AND CURDATE() = @EasterDate, 1, 0)

IF(CURDATE() = DATE_SUB(CONCAT(@ChristmasDate := YEAR(CURDATE()),
'-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM
`verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAYS) AND
CURDATE() = @ChristmasDate, 2, 0)

mysql_close();



What is the problem?

If this is your actual code, the queries aren't in php variables.

$query = IF(curdate()  ;







--
Postgresql  php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] Parse error

2009-09-23 Thread Chris

Ron Piggott wrote:
Let me try this is a different way.  


What is the variable which I am able to retrieve?  I am expecting the
result to be a 0, 1 or 2.  


Your original problem was getting a parse error.

Your query is not php code - step 1 is to fix that.

Once you've done that, post the new code and new problem you're having.

--
Postgresql  php tutorials
http://www.designmagick.com/


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



Re: [PHP-DB] Parse error: syntax error, unexpected '' in C:\wamp\www\new.php on line 38

2009-02-13 Thread Sashikanth Gurram

WOW,

Both of your suggestions worked like magic. Thanks a lot Patrick

-Sashi

Patrick Price wrote:

I believe your problem is that on line 33 you forgot your closing double
quote in the echo statement.

Thanks

patrick
Sent from: Decatur Ga United States.


On Fri, Feb 13, 2009 at 10:02 PM, Sashikanth Gurram sashi...@vt.edu wrote:

  

Hi all,

I have pasted the PHP code I wrote below. I do not know why, but I am
getting the parse error: unexpected ''. It says the error is on line 38.
The exact line on line 38 is
*  echotr\n*

Basically, I am trying to execute an sql query through PHP which tries to
extract data from the mysql database and display the data in the browser.
The query is running fine but I am getting the problems when I try to
display the data in the browser.

Can anyone help me with it?

Thanks,
Sashi

?php
/* CONNECTS TO THE DATABASE*/
$host=**;
$user=**;
$password=***;
$dbname=*;
$cxn=mysqli_connect($host, $user, $password, $dbname);
if (!$cxn=mysqli_connect($host, $user, $password, $dbname))
  {
  $error=mysqli_error($cxn);
  echo $error;
  die();
  }
else
  {
  echo Connection established successfully;
  }
$sql=select * FROM OCCUPANCY;
$data=mysqli_query($cxn,$sql);
if (!$data=mysqli_query($cxn,$sql))
  {
  $error=mysqli_error($cxn);
  echo $error;
  die();
  }
else
  {
  echo Query sent successfully;
  }
echo br;
echo h1OCCUPANCYh1;
echo table cellspacing='5';
echo trtd colspan='7'hr //td/tr;
while ($row=mysqli_fetch_array($data))
  {
  extract($row);
  echotr\n
   td$building/td\n
   td$parking_lot/td\n
   td$month/td\n
   td$day/td\n
   td$occupancy/td\n
   td$empty_spaces/td\n
   td$special_days/td\n
   /tr\n;
  echo trtd colspan='7'hr //td/tr\n;
  }
  echo/table\n;
?

--
~
~
Sashikanth Gurram
Graduate Research Assistant
Department of Civil and Environmental Engineering
Virginia Tech
Blacksburg, VA 24060, USA


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





  



--
~
~
Sashikanth Gurram
Graduate Research Assistant
Department of Civil and Environmental Engineering
Virginia Tech
Blacksburg, VA 24060, USA


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



Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE

2008-04-16 Thread Daniel Brown
On Tue, Apr 15, 2008 at 5:56 PM, Javier Viegas [EMAIL PROTECTED] wrote:
 Thanks Daniel i ´ve removed the unexpected else secction. Now it works but
  it tells me that there might be a syntax error on the query, this is good
  news because now i know i´m having connection with the database but also
  there must be something wrong with the query.


  $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];
[snip!]

You didn't enclose the value in quotes, that's all (and you should
sanitize the input --- NEVER accept data without sanitizing it
first!).

?php
$del_str = DELETE FROM libros WHERE
bnumero='.mysql_real_escape_string($_GET['Id']).' LIMIT 1;
?

-- 
/Daniel P. Brown
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

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



[PHP-DB] Parse error: syntax error, unexpected T_ELSE

2008-04-15 Thread Javier Viegas
Hi, i have this script wich basically connects to a database and delete a
record according to the Id parameter given. The problem is that when i test
it i get this error:

*Parse error*: syntax error, unexpected T_ELSE in *
/var/www/biblio/scripts/delete.php* on line *31

This is the script:

*?php
/*
   deletescore.php:  deletes record for passed id from highscores table and
 returns status to Flash
*/
// fill with correct data for your server configuration
$server = localhost;
$username = root;
$password = itsveryeasy;
$database = biblioteca;

//connect to database added by calm
mysql_connect($server, $username, $password);

if (!mysql_connect($server, $username, $password)) {
   $r_string = 'errorcode=1';

} elseif (!mysql_select_db($database)) {
   $r_string = 'errorcode=2';

} else {

  $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];

  if (!mysql_query ($del_str)) {
 $msg = mysql_error();
 $r_string = 'errorcode=3msg='.$msg;
  } else {
 $r_string = 'errorcode=0';
  }
   } else {
  $r_string = 'errorcode=4';

}

echo $r_string;
?

Wha am i doing wrong??

Thanks.

Javier


Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE

2008-04-15 Thread Daniel Brown
On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas [EMAIL PROTECTED] wrote:
 Hi, i have this script wich basically connects to a database and delete a
  record according to the Id parameter given. The problem is that when i test
  it i get this error:

  *Parse error*: syntax error, unexpected T_ELSE in *
  /var/www/biblio/scripts/delete.php* on line *31

Javier,

This block:

} else {
 $r_string = 'errorcode=4';

}

 is incorrect.  You call an else condition on line 21, so PHP
expects that block to be the last for that if() condition.  Either
remove the } else { and $r_string = 'errorcode=4'; lines or rewrite
the condition.

And if that's your real database login information, change it and
update all of your scripts and systems ASAP.



  This is the script:

  *?php
  /*
deletescore.php:  deletes record for passed id from highscores table and
  returns status to Flash
  */
  // fill with correct data for your server configuration
  $server = localhost;
  $username = root;
  $password = itsveryeasy;
  $database = biblioteca;

  //connect to database added by calm
  mysql_connect($server, $username, $password);

  if (!mysql_connect($server, $username, $password)) {
$r_string = 'errorcode=1';

  } elseif (!mysql_select_db($database)) {
$r_string = 'errorcode=2';

  } else {

   $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];

   if (!mysql_query ($del_str)) {
  $msg = mysql_error();
  $r_string = 'errorcode=3msg='.$msg;
   } else {
  $r_string = 'errorcode=0';
   }
} else {
   $r_string = 'errorcode=4';

  }

  echo $r_string;
  ?

  Wha am i doing wrong??

  Thanks.

  Javier




-- 
/Daniel P. Brown
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

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



Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE

2008-04-15 Thread Javier Viegas
Thanks Daniel i ´ve removed the unexpected else secction. Now it works but
it tells me that there might be a syntax error on the query, this is good
news because now i know i´m having connection with the database but also
there must be something wrong with the query.

$del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];

Is this correct, i´ve checked and the correct syntax to use would be delete
from libros where bnumero='something';
Given 'something' is taken from a variable called Id it seems reasonable to
me the way it is written. Do you see anything wrong?

Thanks again.


On Tue, Apr 15, 2008 at 6:03 PM, Daniel Brown [EMAIL PROTECTED] wrote:

 On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas [EMAIL PROTECTED]
 wrote:
  Hi, i have this script wich basically connects to a database and delete
 a
   record according to the Id parameter given. The problem is that when i
 test
   it i get this error:
 
   *Parse error*: syntax error, unexpected T_ELSE in *
   /var/www/biblio/scripts/delete.php* on line *31

 Javier,

This block:

 } else {
 $r_string = 'errorcode=4';

 }

  is incorrect.  You call an else condition on line 21, so PHP
 expects that block to be the last for that if() condition.  Either
 remove the } else { and $r_string = 'errorcode=4'; lines or rewrite
 the condition.

And if that's your real database login information, change it and
 update all of your scripts and systems ASAP.


 
   This is the script:
 
   *?php
   /*
 deletescore.php:  deletes record for passed id from highscores table
 and
   returns status to Flash
   */
   // fill with correct data for your server configuration
   $server = localhost;
   $username = root;
   $password = itsveryeasy;
   $database = biblioteca;
 
   //connect to database added by calm
   mysql_connect($server, $username, $password);
 
   if (!mysql_connect($server, $username, $password)) {
 $r_string = 'errorcode=1';
 
   } elseif (!mysql_select_db($database)) {
 $r_string = 'errorcode=2';
 
   } else {
 
$del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];
 
if (!mysql_query ($del_str)) {
   $msg = mysql_error();
   $r_string = 'errorcode=3msg='.$msg;
} else {
   $r_string = 'errorcode=0';
}
 } else {
$r_string = 'errorcode=4';
 
   }
 
   echo $r_string;
   ?
 
   Wha am i doing wrong??
 
   Thanks.
 
   Javier
 



 --
 /Daniel P. Brown
 Ask me about:
 Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
 and shared hosting starting @ $2.50/mo.
 Unmanaged, managed, and fully-managed!



RE: [PHP-DB] Parse error: syntax error, unexpected T_ELSE

2008-04-15 Thread Gary Wardell
Hi,

I suggest you echo $del_str to see exactly what your query is.

There may be something unexpected in $_GET['Id'].

Echo the whole query so you can see everything in context.

Gary

 -Original Message-
 From: Javier Viegas [mailto:[EMAIL PROTECTED]
 Sent: Tue, April 15, 2008 5:56 PM
 To: php-db@lists.php.net
 Subject: Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE


 Thanks Daniel i ´ve removed the unexpected else secction. Now
 it works but
 it tells me that there might be a syntax error on the query,
 this is good
 news because now i know i´m having connection with the
 database but also
 there must be something wrong with the query.

 $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];

 Is this correct, i´ve checked and the correct syntax to use
 would be delete
 from libros where bnumero='something';
 Given 'something' is taken from a variable called Id it seems
 reasonable to
 me the way it is written. Do you see anything wrong?

 Thanks again.


 On Tue, Apr 15, 2008 at 6:03 PM, Daniel Brown
 [EMAIL PROTECTED] wrote:

  On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas
 [EMAIL PROTECTED]
  wrote:
   Hi, i have this script wich basically connects to a
 database and delete
  a
record according to the Id parameter given. The problem
 is that when i
  test
it i get this error:
  
*Parse error*: syntax error, unexpected T_ELSE in *
/var/www/biblio/scripts/delete.php* on line *31
 
  Javier,
 
 This block:
 
  } else {
  $r_string = 'errorcode=4';
 
  }
 
   is incorrect.  You call an else condition on line
 21, so PHP
  expects that block to be the last for that if() condition.  Either
  remove the } else { and $r_string = 'errorcode=4'; lines
 or rewrite
  the condition.
 
 And if that's your real database login information, change it and
  update all of your scripts and systems ASAP.
 
 
  
This is the script:
  
*?php
/*
  deletescore.php:  deletes record for passed id from
 highscores table
  and
returns status to Flash
*/
// fill with correct data for your server configuration
$server = localhost;
$username = root;
$password = itsveryeasy;
$database = biblioteca;
  
//connect to database added by calm
mysql_connect($server, $username, $password);
  
if (!mysql_connect($server, $username, $password)) {
  $r_string = 'errorcode=1';
  
} elseif (!mysql_select_db($database)) {
  $r_string = 'errorcode=2';
  
} else {
  
 $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id'];
  
 if (!mysql_query ($del_str)) {
$msg = mysql_error();
$r_string = 'errorcode=3msg='.$msg;
 } else {
$r_string = 'errorcode=0';
 }
  } else {
 $r_string = 'errorcode=4';
  
}
  
echo $r_string;
?
  
Wha am i doing wrong??
  
Thanks.
  
Javier
  
 
 
 
  --
  /Daniel P. Brown
  Ask me about:
  Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
  and shared hosting starting @ $2.50/mo.
  Unmanaged, managed, and fully-managed!
 




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



[PHP-DB] parse error in create statement.

2005-06-14 Thread babu
HI,
 
Whats the error in this code.

$sqlstmt= CREATE USER .$adduser. PROFILE DEFAULT 
 IDENTIFIED BY .$addpass. DEFAULT TABLESPACE USERS 
 TEMPORARY TABLESPACE TEMP 
 QUOTA UNLIMITED 
 ON USERS 
 ACCOUNT UNLOCK;
 GRANT CREATE TABLE TO .$adduser.
 GRANT CREATE TRIGGER TO .$adduser
 GRANT CONNECT TO .$adduser;.


any suggestions.



-
Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail

Re: [PHP-DB] parse error in create statement.

2005-06-14 Thread Chris Ramsay
Check your placement of all the  '.' for a start.

raz

On 6/14/05, babu [EMAIL PROTECTED] wrote:
 HI,
 
 Whats the error in this code.
 
 $sqlstmt= CREATE USER .$adduser. PROFILE DEFAULT
 IDENTIFIED BY .$addpass. DEFAULT TABLESPACE USERS
 TEMPORARY TABLESPACE TEMP
 QUOTA UNLIMITED
 ON USERS
 ACCOUNT UNLOCK;
 GRANT CREATE TABLE TO .$adduser.
 GRANT CREATE TRIGGER TO .$adduser
 GRANT CONNECT TO .$adduser;.
 
 
 any suggestions.
 
 
 
 -
 Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail


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



Re: [PHP-DB] parse error in create statement.

2005-06-14 Thread Chris Ramsay
Also, correct me if I'm wrong, but this needs to be split into two
seperate query strings and executed seperately...

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



Re: [PHP-DB] parse error in create statement.

2005-06-14 Thread Darryl Steyn
$sqlstmt= CREATE USER .$adduser. PROFILE DEFAULT
IDENTIFIED BY .$addpass. DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED
ON USERS
ACCOUNT UNLOCK;
GRANT CREATE TABLE TO .$adduser.
GRANT CREATE TRIGGER TO .$adduser.
GRANT CONNECT TO .$adduser.;

for the .'s


Re: [PHP-DB] parse error in create statement.

2005-06-14 Thread Bastien Koert
Missing a . in the line before the last quote   GRANT CREATE TRIGGER TO 
.$adduser


$sqlstmt= CREATE USER .$adduser. PROFILE DEFAULT
IDENTIFIED BY .$addpass. DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED
ON USERS
ACCOUNT UNLOCK;
GRANT CREATE TABLE TO .$adduser.
GRANT CREATE TRIGGER TO .$adduser.
GRANT CONNECT TO .$adduser;.


bastien


From: Chris Ramsay [EMAIL PROTECTED]
Reply-To: Chris Ramsay [EMAIL PROTECTED]
To: babu [EMAIL PROTECTED]
CC: php-db@lists.php.net
Subject: Re: [PHP-DB] parse error in create statement.
Date: Tue, 14 Jun 2005 10:56:24 +0100

Check your placement of all the  '.' for a start.

raz

On 6/14/05, babu [EMAIL PROTECTED] wrote:
 HI,

 Whats the error in this code.

 $sqlstmt= CREATE USER .$adduser. PROFILE DEFAULT
 IDENTIFIED BY .$addpass. DEFAULT TABLESPACE USERS
 TEMPORARY TABLESPACE TEMP
 QUOTA UNLIMITED
 ON USERS
 ACCOUNT UNLOCK;
 GRANT CREATE TABLE TO .$adduser.
 GRANT CREATE TRIGGER TO .$adduser
 GRANT CONNECT TO .$adduser;.


 any suggestions.



 -
 Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with 
voicemail



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

2004-11-13 Thread Aravalli Sai
hi,
   i am trying to delete an item from inventory
management system done by using php on sqlite...
i had created a button 'delete' and when i submit a
value to be deleted from the table it is giving an error,i think there is some 
problem
with delete logic ...
i am attaching the  following codes:
1)html(delete.html) code which is working..
2)php code(td.php) in which there is error
can anyone help me in figure out the error ...

thanks in advance
---regards




-
Do you Yahoo!?
 Check out the new Yahoo! Front Page. www.yahoo.com

[PHP-DB] parse error (with coding)

2004-11-13 Thread Aravalli Sai
hi
  i had created an inventory management system..using
php on sqlitei can successfully insert the values
in it..but when i try to delete an item it is giving
me an error...i think there is some logical problem in
delete statement...
can anyone help me in figure out this error..

thanks in advance...


i am attaching the code 



HTML
HEAD
titleView Inventory/title
body topmargin=0 leftmargin=0 bgcolor=#D2E9FF
table cellSpacing=0 cellPadding=0 width=100%
bgColor=#003366 border=0
  tr
td width=60%p align=centerfont
color=#ff size=7 face=Century Gothicb
   University of New Orleans/b/font/td
  /tr
/table
table cellSpacing=0 cellPadding=0 width=100%
border=0 height=30
tbody
table cellSpacing=0 cellPadding=0 width=100%
border=0
height=30
/HEAD
body

?php
$db =/home/saravall/.HTML/office.db;
$handle = sqlite_open($db) or die(could not open
database);
if(isset($_POST['submit'])) {
if (!empty($_POST['tagno']))
{
$insquery = delete from inventory where tagno=1;
insresult = sqlite_query($handle,$insquery) or
die(error:.sqlite_error_string(sqlite_last_error($handle)));
echo isuccessfully deleted!/i;
}
else
{
echo ihahah!!!/i;
}
}

$query = SELECT * FROM inventory ;
$result = sqlite_query($handle,$query) or

die(err:.sqlite_error_string(sqlite_last_error($handle)));
if (sqlite_num_rows($result)  0)
{
echo table cellpadding=20 border=1;
while ($row = sqlite_fetch_array($result))
{
echo tr;
echo td.$row[0]./td;
echo td.$row[1]./td;
echo td.$row[2]./td;
echo td.$row[3]./td;
echo td.$row[4]./td;
echo td.$row[5]./td;
echo td.$row[6]./td;
echo td.$row[7]./td;
echo td.$row[8]./td;
echo td.$row[9]./td;
echo /tr;
}
echo /table;
}
sqlite_close($handle);
?
/body
/html
 





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP-DB] parse error in php code backend SQLite

2004-10-20 Thread Aravalli Sai
  
hi
 this is php code for inventory management system
 which is done using SQLite.this is an user
interface where an user wil giv values to the text
boxes and it should be saved in the backend database
which is sqlite..
but when i run this code on browser it is giving an
error ... Parse error: parse error in
/home/saravall/.HTML/inv.php on line 81

HTML
HEAD
/HEAD
body
?php

$db =/home/saravall/office.db;
$handle = sqlite_open($db) or die(could not open
database);

if(isset($_POST['submit'])) {

if (!empty($_post['tagno'])  !empty
($_post['desc']) 
!empty ($_post['acqdt'])  !empty
($_post['manufacturer'])  !empty
 ($_post['model']) !empty($_post['serialid']) 
!empty( $_post
['custloc'])  !empty($_post['totcost']))
 {
$insquery = insert into inventory
(tagno,desc,acqdt,manufacturer,model, serial
id,custloc,totcost) values (\.sqlite_escape_string(
$_post['tagno']).\,\.sqlite_escape_string($_post['desc']).\,\
.sqlite_escape_string($_post['serialid']).\,\.sqlite_escape_string($_post
['custloc']).\,\.sqlite_escape_string($_post['totcost']).\);
 
 
$insresult = sqlite_query($handle,$insquery) or
die(error:.sqlite_error_string(sqlite_last_error($handle)));
echo isuccessfully inserted!/ip /;
}
else {
echo iincomplete from input!/ip /;
  $query = SELECT * FROM inventory ;
$result = sqlite_query($handle,$query) or

die(err:.sqlite_error_string(sqlite_last_error($handle)));
if (sqlite_num_rows($result)  0)
{
echo table cellpadding=20 border=1;
while ($row = sqlite_fetch_array($result))
{
echo tr;
echo td.$row[0]./td;
echo td.$row[1]./td;
echo td.$row[2]./td;
echo td.$row[3]./td;
echo td.$row[4]./td;
echo td.$row[5]./td;
echo td.$row[6]./td;
echo td.$row[7]./td;
echo td.$row[8]./td;
echo td.$row[9]./td;
echo /tr;
}
echo /table;

}
sqlite_close($handle);
?
p
h2  
enter  new record:/h2
form method=post action=?php  echo
$_server['php_self'];?
Tag number:input type=text name=number  
br/
desc:input type=text name=desc
br/
acq date:input type=text name=date
br/
manufacturer:input type=text name=manufacturer
br/  
model:input type=text name=model
br/ 
serial id:input type=text name=serial id
br/
custodian location:input type=text
name=custodian
br/
sum cost:input type=text name=cost
br/
input type=submit name=submit value =save
/p
/form
/body
/HTML



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



[PHP-DB] parse error in php backend sqlite

2004-10-20 Thread Aravalli Sai
hi 
  this is php code for inventory management system
which is done using SQLite.this is an user
interface where an user wil giv values to the text
boxes and it should be saved in the backend database
which is sqlite..
but when i run this code on browser it is giving an
error ... Parse error: parse error in
/home/saravall/.HTML/inv.php on line 63

HTML
HEAD
/HEAD
body
?php

$db =/home/saravall/office.db;
$handle = sqlite_open($db) or die(could not open
database);

if(isset($_POST['submit'])) {

if (!empty($_post['tagno'])  !empty
($_post['desc']) 
!empty ($_post['acqdt'])  !empty
($_post['manufacturer'])  !empty
 ($_post['model']) !empty($_post['serialid']) 
!empty( $_post
['custloc'])  !empty($_post['totcost']))
 {
$insquery = insert into inventory
(tagno,desc,acqdt,manufacturer,model, serial
id,custloc,totcost) values (\.sqlite_escape_string(
$_post['tagno']).\,\.sqlite_escape_string($_post['desc']).\,\
.sqlite_escape_string($_post['serialid']).\,\.sqlite_escape_string($_post
['custloc']).\,\.sqlite_escape_string($_post['totcost']).\);
 
 
$insresult = sqlite_query($handle,$insquery) or
die(error:.sqlite_error_string(sqlite_last_error($handle)));
echo isuccessfully inserted!/ip /;
}
else {
echo iincomplete from input!/ip /;
  $query = SELECT * FROM inventory ;
$result = sqlite_query($handle,$query) or

die(err:.sqlite_error_string(sqlite_last_error($handle)));
if (sqlite_num_rows($result)  0)
{
echo table cellpadding=20 border=1;
while ($row = sqlite_fetch_array($result))
{
echo tr;
echo td.$row[0]./td;
echo td.$row[1]./td;
echo td.$row[2]./td;
echo td.$row[3]./td;
echo td.$row[4]./td;
echo td.$row[5]./td;
echo td.$row[6]./td;
echo td.$row[7]./td;
echo td.$row[8]./td;
echo td.$row[9]./td;
echo /tr;
}
echo /table;

}
sqlite_close($handle);
?
/body
/html


i would appreciate if you can help me in correcting
this error..
thanks in advance..
sai



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



Re: [PHP-DB] parse error in php backend sqlite

2004-10-20 Thread Jennifer Goodie
- Original message from Aravalli Sai : -- 
 but when i run this code on browser it is giving an 
 error ... Parse error: parse error in 
 /home/saravall/.HTML/inv.php on line 63 
 

It would be helpful if you said what the parse error is and which line is 63.
 
 if(isset($_POST['submit'])) { 
 
 if (!empty($_post['tagno'])  !empty 

Why are you switching between $_POST and $_post?  The superglobal array is $_POST.

 i would appreciate if you can help me in correcting 
 this error.. 
 thanks in advance.. 
 sai 

Your curly braces, {}, don't match up.  You aren't closing them all.  Indenting your 
code will help you see this and fix the problem.

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



Re: [PHP-DB] parse error in php backend sqlite

2004-10-20 Thread Doug Thompson
Aravalli Sai wrote:
hi 
  this is php code for inventory management system
which is done using SQLite.this is an user
interface where an user wil giv values to the text
boxes and it should be saved in the backend database
which is sqlite..
but when i run this code on browser it is giving an
error ... Parse error: parse error in
/home/saravall/.HTML/inv.php on line 63

HTML
HEAD
/HEAD
body
?php
$db =/home/saravall/office.db;
$handle = sqlite_open($db) or die(could not open
database);
if(isset($_POST['submit'])) {
if (!empty($_post['tagno'])  !empty
($_post['desc']) 
!empty ($_post['acqdt'])  !empty
($_post['manufacturer'])  !empty
 ($_post['model']) !empty($_post['serialid']) 
!empty( $_post
['custloc'])  !empty($_post['totcost']))
 {
$insquery = insert into inventory
(tagno,desc,acqdt,manufacturer,model, serial
id,custloc,totcost) values (\.sqlite_escape_string(
$_post['tagno']).\,\.sqlite_escape_string($_post['desc']).\,\
.sqlite_escape_string($_post['serialid']).\,\.sqlite_escape_string($_post
['custloc']).\,\.sqlite_escape_string($_post['totcost']).\);
 
 
$insresult = sqlite_query($handle,$insquery) or
die(error:.sqlite_error_string(sqlite_last_error($handle)));
echo isuccessfully inserted!/ip /;
}
else {
echo iincomplete from input!/ip /;
  $query = SELECT * FROM inventory ;
$result = sqlite_query($handle,$query) or

die(err:.sqlite_error_string(sqlite_last_error($handle)));
if (sqlite_num_rows($result)  0)
{
echo table cellpadding=20 border=1;
while ($row = sqlite_fetch_array($result))
{
echo tr;
echo td.$row[0]./td;
echo td.$row[1]./td;
echo td.$row[2]./td;
echo td.$row[3]./td;
echo td.$row[4]./td;
echo td.$row[5]./td;
echo td.$row[6]./td;
echo td.$row[7]./td;
echo td.$row[8]./td;
echo td.$row[9]./td;
echo /tr;
}
echo /table;
}
sqlite_close($handle);
?
/body
/html
i would appreciate if you can help me in correcting
this error..
thanks in advance..
sai
Your braces don't match up.  The problem starts at the ELSE statement in line 33.
Doug
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Dillon, John

On line 188 and similar:
line 187$this=$altIDs[$i]; 
line 188$query .= ID='$this'; 

I get the error: Parse error: parse error in
/home/jdillon/public_html/provreport.php on line 188

Could this be because some setting has been changed on my shared host?

John

































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html

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



RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Hutchins, Richard
Speaking for myself only, I'm probably going to need to see more code than
this to be able to help. These two lines appear to be OK. The error might be
in what feeds line 187.

 -Original Message-
 From: Dillon, John [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 20, 2003 9:16 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Parse error on array and SQL query
 
 
 
 On line 188 and similar:
   line 187$this=$altIDs[$i]; 
   line 188$query .= ID='$this'; 
 
 I get the error: Parse error: parse error in
 /home/jdillon/public_html/provreport.php on line 188
 
 Could this be because some setting has been changed on my shared host?
 
 John
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    http://www.cantor.com
 CONFIDENTIAL: This e-mail, including its contents and 
 attachments, if any, are confidential. If you are not the 
 named recipient please notify the sender and immediately 
 delete it. You may not disseminate, distribute, or forward 
 this e-mail message or disclose its contents to anybody else. 
 Copyright and any other intellectual property rights in its 
 contents are the sole property of Cantor Fitzgerald.
  E-mail transmission cannot be guaranteed to be secure or 
 error-free. The sender therefore does not accept liability 
 for any errors or omissions in the contents of this message 
 which arise as a result of e-mail transmission.  If 
 verification is required please request a hard-copy version.
  Although we routinely screen for viruses, addressees 
 should check this e-mail and any attachments for viruses. We 
 make no representation or warranty as to the absence of 
 viruses in this e-mail or any attachments. Please note that 
 to ensure regulatory compliance and for the protection of our 
 customers and business, we may monitor and read e-mails sent 
 to and from our server(s). 
 
 For further important information, please read the  Important 
 Legal Information and Legal Statement at 
 http://www.cantor.com/legal_information.html
 
 -- 
 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] Parse error on array and SQL query

2003-11-20 Thread Dillon, John
My host provider suggested escaping the SQL: $query .= ID=\'$this\'; which
gets rid of the php error but gives invalid SQL.  After a few exchanges with
them it suddenly worked again as: $query .= ID='$this';.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: 20 November 2003 14:43
To: 'Dillon, John'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Parse error on array and SQL query


Speaking for myself only, I'm probably going to need to see more code than
this to be able to help. These two lines appear to be OK. The error might be
in what feeds line 187.

 -Original Message-
 From: Dillon, John [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 20, 2003 9:16 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Parse error on array and SQL query
 
 
 
 On line 188 and similar:
   line 187$this=$altIDs[$i]; 
   line 188$query .= ID='$this'; 
 
 I get the error: Parse error: parse error in
 /home/jdillon/public_html/provreport.php on line 188
 
 Could this be because some setting has been changed on my shared host?
 
 John
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    http://www.cantor.com
 CONFIDENTIAL: This e-mail, including its contents and 
 attachments, if any, are confidential. If you are not the 
 named recipient please notify the sender and immediately 
 delete it. You may not disseminate, distribute, or forward 
 this e-mail message or disclose its contents to anybody else. 
 Copyright and any other intellectual property rights in its 
 contents are the sole property of Cantor Fitzgerald.
  E-mail transmission cannot be guaranteed to be secure or 
 error-free. The sender therefore does not accept liability 
 for any errors or omissions in the contents of this message 
 which arise as a result of e-mail transmission.  If 
 verification is required please request a hard-copy version.
  Although we routinely screen for viruses, addressees 
 should check this e-mail and any attachments for viruses. We 
 make no representation or warranty as to the absence of 
 viruses in this e-mail or any attachments. Please note that 
 to ensure regulatory compliance and for the protection of our 
 customers and business, we may monitor and read e-mails sent 
 to and from our server(s). 
 
 For further important information, please read the  Important 
 Legal Information and Legal Statement at 
 http://www.cantor.com/legal_information.html
 
 -- 
 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] Parse error on array and SQL query

2003-11-20 Thread John W. Holmes
Dillon, John wrote:

On line 188 and similar:
	line 187		$this=$altIDs[$i]; 
	line 188		$query .= ID='$this'; 

I get the error: Parse error: parse error in
/home/jdillon/public_html/provreport.php on line 188
Could this be because some setting has been changed on my shared host?
$this is normally used in object oriented programming to signify the 
current object. That may be causing the trouble. I'd use another 
variable than $this.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Dillon, John

Dillon, John wrote:

 On line 188 and similar:
   line 187$this=$altIDs[$i]; 
   line 188$query .= ID='$this'; 
 
 I get the error: Parse error: parse error in
 /home/jdillon/public_html/provreport.php on line 188
 
 Could this be because some setting has been changed on my shared host?

$this is normally used in object oriented programming to signify the 
current object. That may be causing the trouble. I'd use another 
variable than $this.

-- 
---John Holmes...


Tried that, doesn't work with:

$query=INSERT INTO ReplyTbl VALUES (' . $monster1 . ', ' . $monster2 .
', ' . $monster3 . ', NULL, NULL);

Don't suppose they use 'monster' as a reserved word...

but the similar code works in another file.

John


http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html

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



Re: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread John W. Holmes
Dillon, John wrote:

 Tried that, doesn't work with:

 $query=INSERT INTO ReplyTbl VALUES (' . $monster1 . ', ' .
 $monster2 .
 ', ' . $monster3 . ', NULL, NULL);

 Don't suppose they use 'monster' as a reserved word...
How does it not work again??

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Hutchins, Richard
If you're not getting the parse error anymore, I'd suggest you echo $query
to the browser and check to see that the SQL statement is what you expect it
to be. Can't count the number of times doing that has pointed out some stray
apostrophe or comma or something that killed the query.

 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 20, 2003 1:09 PM
 To: Dillon, John
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Parse error on array and SQL query
 
 
 Dillon, John wrote:
 
   Tried that, doesn't work with:
  
   $query=INSERT INTO ReplyTbl VALUES (' . $monster1 . ', ' .
   $monster2 .
   ', ' . $monster3 . ', NULL, NULL);
  
   Don't suppose they use 'monster' as a reserved word...
 
 How does it not work again??
 
 -- 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals – www.phparch.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



[PHP-DB] parse error.

2003-09-25 Thread Mücella Erdem Efe
I am a new programmer of PHP4.3.3 an MySql 3.23 .

When below script is executed
Parse error: parse error, unexpected T_DNUMBER in c:\program
files\apache group\apache\htdocs\ilkdeneme21.php on line 17
 is being seen.

This may be very simple but I could not solve it.Could you help me for this
error?
Thanks for your attention
[EMAIL PROTECTED]


?
$dbname = 'mycmpe';

mysql_connect(localhost,username);
if (mysql_select_db($dbname))
{ echo connected;}
else
{ echo not connected;}

$query=insert into dene (day,start_time) values (2003.09.25,22:30)  ;
   $result=mysql_query($query);
   if ($result))
{ echo data girildi;}
else
{ echo data girilemedi;
  exit;}

?

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



SV: [PHP-DB] parse error.

2003-09-25 Thread Henrik Hornemann
Hi,

There are at least two errors in your script:

$query=insert into dene (day,start_time) values (2003.09.25,22:30)  ;
should be
$query=insert into dene (day,start_time) values ('2003.09.25','22:30')  ;

And
if ($result))
should be
if ($result)

regards Henrik Hornemann

 -Oprindelig meddelelse-
 Fra: Mücella Erdem Efe [mailto:[EMAIL PROTECTED]
 Sendt: 26. september 2003 00:52
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] parse error.
 
 
 I am a new programmer of PHP4.3.3 an MySql 3.23 .
 
 When below script is executed
 Parse error: parse error, unexpected T_DNUMBER in c:\program
 files\apache group\apache\htdocs\ilkdeneme21.php on line 17
  is being seen.
 
 This may be very simple but I could not solve it.Could you 
 help me for this
 error?
 Thanks for your attention
 [EMAIL PROTECTED]
 
 
 ?
 $dbname = 'mycmpe';
 
 mysql_connect(localhost,username);
 if (mysql_select_db($dbname))
 { echo connected;}
 else
 { echo not connected;}
 
 $query=insert into dene (day,start_time) values 
 (2003.09.25,22:30)  ;
$result=mysql_query($query);
if ($result))
 { echo data girildi;}
 else
 { echo data girilemedi;
   exit;}
 
 ?
 
 -- 
 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] parse error.

2003-09-25 Thread Steve Davies
Hi Micella

You need to either slash-escape your insert query or use single quotes:

$query=insert into dene (day,start_time) values (\2003.09.25\,\22:30\)  ;

or

$query=insert into dene (day,start_time) values ('2003.09.25','22:30')  ;

steve

M|cella Erdem Efe wrote:

I am a new programmer of PHP4.3.3 an MySql 3.23 .

When below script is executed
   Parse error: parse error, unexpected T_DNUMBER in c:\program
files\apache group\apache\htdocs\ilkdeneme21.php on line 17
is being seen.
This may be very simple but I could not solve it.Could you help me for this
error?
Thanks for your attention
[EMAIL PROTECTED]
?
$dbname = 'mycmpe';
mysql_connect(localhost,username);
if (mysql_select_db($dbname))
{ echo connected;}
else
{ echo not connected;}
$query=insert into dene (day,start_time) values (2003.09.25,22:30)  ;
  $result=mysql_query($query);
  if ($result))
{ echo data girildi;}
else
{ echo data girilemedi;
 exit;}
?

 

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


[PHP-DB] Parse error

2003-03-20 Thread [EMAIL PROTECTED]

I am having a problem with a parse error.

error:
Parse error: parse error, unexpected ')' in
/Users/timbest/Sites/cajunmikes/inc/menupage.php on line 75

Fatal error: Cannot instantiate non-existent class: menu in
/Users/timbest/Sites/cajunmikes/TMPfj18cc2i20.php on line 7

The issue I am having is line 75 has no ')'.  I am sure this error is
causing the next fatal error.  Anyone seen this before?  I'm not sure what
to do next since there is nothing on line 75...

Thanks
/T 


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



Re: [PHP-DB] Parse error

2003-03-20 Thread Max 'AMiGo' Gashkov
[EMAIL PROTECTED] wrote:


IBI I am having a problem with a parse error.

IBI error:
IBI Parse error: parse error, unexpected ')' in
IBI /Users/timbest/Sites/cajunmikes/inc/menupage.php on line 75

IBI Fatal error: Cannot instantiate non-existent class: menu in
IBI /Users/timbest/Sites/cajunmikes/TMPfj18cc2i20.php on line 7

IBI The issue I am having is line 75 has no ')'.  I am sure this error is
IBI causing the next fatal error.  Anyone seen this before?  I'm not sure what
IBI to do next since there is nothing on line 75...

IBI Thanks
IBI /T 


Post some code here...



WBR,   Max 'AMiGo' Gashkov
[EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
http://www.journals.ru/users/endymion
Distributed.net participant [408228][RC5-72]
__
NP: [DJ DADO/ FINE ARTS] next madness


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



[PHP-DB] Parse Error

2003-02-26 Thread Chris Payne
Hi there everyone,

I'm trying to run an if statement and inside that have other if's, but it keeps 
telling me I have a parse error on the first if in the if statement (The second if 
down).  Can anyone see what i'm doing wrong?

if ($packages == 1)(

if ($airporttransfer == car)(
$airporttransfer2 = 12.00);
if ($airporttransfer == bus)(
$airporttransfer2 = 10.00);
if ($airporttransfer == none)(
$airporttransfer2 = 0.00);

);

Thanks for your help :-)

Chris

Re: [PHP-DB] Parse Error

2003-02-26 Thread Micah Stevens
If statements use curly braces. Do this: 


if ($packages == 1){

if ($airporttransfer == car)
$airporttransfer2 = 12.00);
if ($airporttransfer == bus)
$airporttransfer2 = 10.00);
if ($airporttransfer == none)
$airporttransfer2 = 0.00);

}



On Wed, 2003-02-26 at 16:42, Chris Payne wrote:

 Hi there everyone,
 
 I'm trying to run an if statement and inside that have other if's, but it keeps 
 telling me I have a parse error on the first if in the if statement (The second if 
 down).  Can anyone see what i'm doing wrong?
 
 if ($packages == 1)(
 
 if ($airporttransfer == car)(
 $airporttransfer2 = 12.00);
 if ($airporttransfer == bus)(
 $airporttransfer2 = 10.00);
 if ($airporttransfer == none)(
 $airporttransfer2 = 0.00);
 
 );
 
 Thanks for your help :-)
 
 Chris


RE: [PHP-DB] Parse Error

2003-02-26 Thread Peter Lovatt

if ($packages == 1){

if ($airporttransfer == car){
$airporttransfer2 = 12.00};
if ($airporttransfer == bus){
$airporttransfer2 = 10.00};
if ($airporttransfer == none){
$airporttransfer2 = 0.00};

};


() round brackets round the condition {} braces around the 'do it' bit :)

HTH

Peter

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]
Sent: 27 February 2003 00:43
To: php
Subject: [PHP-DB] Parse Error


Hi there everyone,

I'm trying to run an if statement and inside that have other if's, but it
keeps telling me I have a parse error on the first if in the if statement
(The second if down).  Can anyone see what i'm doing wrong?

if ($packages == 1)(

if ($airporttransfer == car)(
$airporttransfer2 = 12.00);
if ($airporttransfer == bus)(
$airporttransfer2 = 10.00);
if ($airporttransfer == none)(
$airporttransfer2 = 0.00);

);

Thanks for your help :-)

Chris



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



[PHP-DB] Parse Error...

2002-12-02 Thread Chase
When trying to execute the following script to send the contents of a table
via mail() I am getting this error...

Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36

The portion of this code inside the HTML tags works great for displaying the
table on the screen, but when I include it in the larger script for sending
a mail message, I get this error.

I am sure that it is something simple that I have been too stupid to catch,
but any help would be great!

Chase


Code Follows  ---

?
$server = ;
$user = ;
$pass = ;
$db = ;
$table = ;
?

?
$to  = CKnott [EMAIL PROTECTED] . ,  ;
$to .= Chase [EMAIL PROTECTED];

$subject = Price File Access History;

$message = '
html
headtitlePrice File Access/title/head

body
table border=1 align=center
tr
td
  div align=centerbiDate / Time/i/b/div
/td
td
  div align=centeribLogged IP Address/b/i/div
/td
td
  div align=centeribLogged Username/b/i/div
/td
/tr

$link = mysql_connect($server, $user, $pass);
mysql_select_db($db, $link);

$result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
DESC,$link);
$num_rows = mysql_num_rows($result);

if($num_rows) {
//   print(ptable border=1 align=center);
   while($row = mysql_fetch_row($result))

   {

  print(tr);
  print(td$row[0]/td);
  print(td$row[1]/td);
  print(td$row[2]/td);
  print(/tr);


   }
   print(/table/p);
 } else {
   print(No Files To Show!!);

 }

/body
/html
';

$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;

$headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;

mail($to, $subject, $message, $headers);

?




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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Micah Stevens
There aren't any closing quotes on your $message variable or semicolon
to tell the parser that you're done with the assignment statement.

-Micah





On Mon, 2002-12-02 at 15:05, Chase wrote:
 When trying to execute the following script to send the contents of a table
 via mail() I am getting this error...
 
 Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
 
 The portion of this code inside the HTML tags works great for displaying the
 table on the screen, but when I include it in the larger script for sending
 a mail message, I get this error.
 
 I am sure that it is something simple that I have been too stupid to catch,
 but any help would be great!
 
 Chase
 
 
 Code Follows  ---
 
 ?
 $server = ;
 $user = ;
 $pass = ;
 $db = ;
 $table = ;
 ?
 
 ?
 $to  = CKnott [EMAIL PROTECTED] . ,  ;
 $to .= Chase [EMAIL PROTECTED];
 
 $subject = Price File Access History;
 
 $message = '
 html
 headtitlePrice File Access/title/head
 
 body
 table border=1 align=center
 tr
 td
   div align=centerbiDate / Time/i/b/div
 /td
 td
   div align=centeribLogged IP Address/b/i/div
 /td
 td
   div align=centeribLogged Username/b/i/div
 /td
 /tr
 
 $link = mysql_connect($server, $user, $pass);
 mysql_select_db($db, $link);
 
 $result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
 DESC,$link);
 $num_rows = mysql_num_rows($result);
 
 if($num_rows) {
 //   print(ptable border=1 align=center);
while($row = mysql_fetch_row($result))
 
{
 
   print(tr);
   print(td$row[0]/td);
   print(td$row[1]/td);
   print(td$row[2]/td);
   print(/tr);
 
 
}
print(/table/p);
  } else {
print(No Files To Show!!);
 
  }
 
 /body
 /html
 ';
 
 $headers  = MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 
 $headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;
 
 mail($to, $subject, $message, $headers);
 
 ?
 
-- 
Raincross Technologies
Development and Consulting Services
http://www.raincross-tech.com



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
  There is a single quote and semicolon on the line under /html that I
thought would be defining the end of the assignment.
  Should I have used double quotes instead of single?

Chase


Micah Stevens [EMAIL PROTECTED] wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
 There aren't any closing quotes on your $message variable or semicolon
 to tell the parser that you're done with the assignment statement.

 -Micah





 On Mon, 2002-12-02 at 15:05, Chase wrote:
  When trying to execute the following script to send the contents of a
table
  via mail() I am getting this error...
 
  Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
 
  The portion of this code inside the HTML tags works great for displaying
the
  table on the screen, but when I include it in the larger script for
sending
  a mail message, I get this error.
 
  I am sure that it is something simple that I have been too stupid to
catch,
  but any help would be great!
 
  Chase
 
 
  Code Follows  ---
 
  ?
  $server = ;
  $user = ;
  $pass = ;
  $db = ;
  $table = ;
  ?
 
  ?
  $to  = CKnott [EMAIL PROTECTED] . ,  ;
  $to .= Chase [EMAIL PROTECTED];
 
  $subject = Price File Access History;
 
  $message = '
  html
  headtitlePrice File Access/title/head
 
  body
  table border=1 align=center
  tr
  td
div align=centerbiDate / Time/i/b/div
  /td
  td
div align=centeribLogged IP Address/b/i/div
  /td
  td
div align=centeribLogged Username/b/i/div
  /td
  /tr
 
  $link = mysql_connect($server, $user, $pass);
  mysql_select_db($db, $link);
 
  $result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
  DESC,$link);
  $num_rows = mysql_num_rows($result);
 
  if($num_rows) {
  //   print(ptable border=1 align=center);
 while($row = mysql_fetch_row($result))
 
 {
 
print(tr);
print(td$row[0]/td);
print(td$row[1]/td);
print(td$row[2]/td);
print(/tr);
 
 
 }
 print(/table/p);
   } else {
 print(No Files To Show!!);
 
   }
 
  /body
  /html
  ';
 
  $headers  = MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 
  $headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;
 
  mail($to, $subject, $message, $headers);
 
  ?
 
 --
 Raincross Technologies
 Development and Consulting Services
 http://www.raincross-tech.com





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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Jim Hunter
In that case, your logic is not going to work. You have live PHP code inside
a string. You are going to need to build the $message in pieces. Start with
the HTML, then add the result from each itteration of your PHP loop to
$message then add the trailing HTML to form the complete $message. 

Your close, but it's just not going to work like you think it will.

Jim

 
---Original Message---
 
From: Chase
Date: Monday, December 02, 2002 04:34:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error...
 
There is a single quote and semicolon on the line under /html that I
thought would be defining the end of the assignment.
Should I have used double quotes instead of single?

Chase


Micah Stevens [EMAIL PROTECTED] wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
 There aren't any closing quotes on your $message variable or semicolon
 to tell the parser that you're done with the assignment statement.

 -Micah





 On Mon, 2002-12-02 at 15:05, Chase wrote:
  When trying to execute the following script to send the contents of a
table
  via mail() I am getting this error...
 
  Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
 
  The portion of this code inside the HTML tags works great for displaying
the
  table on the screen, but when I include it in the larger script for
sending
  a mail message, I get this error.
 
  I am sure that it is something simple that I have been too stupid to
catch,
  but any help would be great!
 
  Chase
 
 
  Code Follows ---
 
  ?
  $server = ;
  $user = ;
  $pass = ;
  $db = ;
  $table = ;
  ?
 
  ?
  $to = CKnott [EMAIL PROTECTED] . ,  ;
  $to .= Chase [EMAIL PROTECTED];
 
  $subject = Price File Access History;
 
  $message = '
  html
  headtitlePrice File Access/title/head
 
  body
  table border=1 align=center
  tr
  td
  div align=centerbiDate / Time/i/b/div
  /td
  td
  div align=centeribLogged IP Address/b/i/div
  /td
  td
  div align=centeribLogged Username/b/i/div
  /td
  /tr
 
  $link = mysql_connect($server, $user, $pass);
  mysql_select_db($db, $link);
 
  $result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
  DESC,$link);
  $num_rows = mysql_num_rows($result);
 
  if($num_rows) {
  // print(ptable border=1 align=center);
  while($row = mysql_fetch_row($result))
 
  {
 
  print(tr);
  print(td$row[0]/td);
  print(td$row[1]/td);
  print(td$row[2]/td);
  print(/tr);
 
 
  }
  print(/table/p);
  } else {
  print(No Files To Show!!);
 
  }
 
  /body
  /html
  ';
 
  $headers = MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 
  $headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;
 
  mail($to, $subject, $message, $headers);
 
  ?
 
 --
 Raincross Technologies
 Development and Consulting Services
 http://www.raincross-tech.com





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

. 


Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
  Okay, you just jumped WAY outside my basic knowledge...  However, it does
make perfect sense, so I am off to the library...

Chase


Jim Hunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
In that case, your logic is not going to work. You have live PHP code inside
a string. You are going to need to build the $message in pieces. Start with
the HTML, then add the result from each itteration of your PHP loop to
$message then add the trailing HTML to form the complete $message.

Your close, but it's just not going to work like you think it will.

Jim


---Original Message---

From: Chase
Date: Monday, December 02, 2002 04:34:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error...

There is a single quote and semicolon on the line under /html that I
thought would be defining the end of the assignment.
Should I have used double quotes instead of single?

Chase


Micah Stevens [EMAIL PROTECTED] wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
 There aren't any closing quotes on your $message variable or semicolon
 to tell the parser that you're done with the assignment statement.

 -Micah





 On Mon, 2002-12-02 at 15:05, Chase wrote:
  When trying to execute the following script to send the contents of a
table
  via mail() I am getting this error...
 
  Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
 
  The portion of this code inside the HTML tags works great for displaying
the
  table on the screen, but when I include it in the larger script for
sending
  a mail message, I get this error.
 
  I am sure that it is something simple that I have been too stupid to
catch,
  but any help would be great!
 
  Chase
 
 
  Code Follows ---
 
  ?
  $server = ;
  $user = ;
  $pass = ;
  $db = ;
  $table = ;
  ?
 
  ?
  $to = CKnott [EMAIL PROTECTED] . ,  ;
  $to .= Chase [EMAIL PROTECTED];
 
  $subject = Price File Access History;
 
  $message = '
  html
  headtitlePrice File Access/title/head
 
  body
  table border=1 align=center
  tr
  td
  div align=centerbiDate / Time/i/b/div
  /td
  td
  div align=centeribLogged IP Address/b/i/div
  /td
  td
  div align=centeribLogged Username/b/i/div
  /td
  /tr
 
  $link = mysql_connect($server, $user, $pass);
  mysql_select_db($db, $link);
 
  $result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
  DESC,$link);
  $num_rows = mysql_num_rows($result);
 
  if($num_rows) {
  // print(ptable border=1 align=center);
  while($row = mysql_fetch_row($result))
 
  {
 
  print(tr);
  print(td$row[0]/td);
  print(td$row[1]/td);
  print(td$row[2]/td);
  print(/tr);
 
 
  }
  print(/table/p);
  } else {
  print(No Files To Show!!);
 
  }
 
  /body
  /html
  ';
 
  $headers = MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 
  $headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;
 
  mail($to, $subject, $message, $headers);
 
  ?
 
 --
 Raincross Technologies
 Development and Consulting Services
 http://www.raincross-tech.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] Parse Error...

2002-12-02 Thread Micah Stevens
Remember, the print() function sends stuff to the browser. If you wish
to make the code output to the $message variable, you must use
additional assignment statements. 

I made some quick changes to the code below, try that:

?
$server = ;
$user = ;
$pass = ;
$db = ;
$table = ;
?

?
$to  = CKnott [EMAIL PROTECTED] . ,  ;
$to .= Chase [EMAIL PROTECTED];

$subject = Price File Access History;

$message = '
html
headtitlePrice File Access/title/head

body
table border=1 align=center
tr
td
  div align=centerbiDate / Time/i/b/div
/td
td
  div align=centeribLogged IP Address/b/i/div
/td
td
  div align=centeribLogged Username/b/i/div
/td
/tr
';

$link = mysql_connect($server, $user, $pass);
mysql_select_db($db, $link);

$result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
DESC,$link);
$num_rows = mysql_num_rows($result);

if($num_rows) {
//   print(ptable border=1 align=center);
   while($row = mysql_fetch_row($result))

   {

  $message .= tr;
  $message .= td$row[0]/td;
  $message .= td$row[1]/td;
  $message .= td$row[2]/td;
  $message .= /tr;


   }
   $message .= /table/p;
 } else {
   $message .= No Files To Show!!;

 }
$message .= /body
/html
;

$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;

$headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;

mail($to, $subject, $message, $headers);

?



On Mon, 2002-12-02 at 16:30, Chase wrote:
   There is a single quote and semicolon on the line under /html that I
 thought would be defining the end of the assignment.
   Should I have used double quotes instead of single?
 
 Chase
 
 
 Micah Stevens [EMAIL PROTECTED] wrote in message
 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
  There aren't any closing quotes on your $message variable or semicolon
  to tell the parser that you're done with the assignment statement.
 
  -Micah
 
 
 
 
 
  On Mon, 2002-12-02 at 15:05, Chase wrote:
   When trying to execute the following script to send the contents of a
 table
   via mail() I am getting this error...
  
   Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
  
   The portion of this code inside the HTML tags works great for displaying
 the
   table on the screen, but when I include it in the larger script for
 sending
   a mail message, I get this error.
  
   I am sure that it is something simple that I have been too stupid to
 catch,
   but any help would be great!
  
   Chase
  
  
   Code Follows  ---
  
   ?
   $server = ;
   $user = ;
   $pass = ;
   $db = ;
   $table = ;
   ?
  
   ?
   $to  = CKnott [EMAIL PROTECTED] . ,  ;
   $to .= Chase [EMAIL PROTECTED];
  
   $subject = Price File Access History;
  
   $message = '
   html
   headtitlePrice File Access/title/head
  
   body
   table border=1 align=center
   tr
   td
 div align=centerbiDate / Time/i/b/div
   /td
   td
 div align=centeribLogged IP Address/b/i/div
   /td
   td
 div align=centeribLogged Username/b/i/div
   /td
   /tr
  
   $link = mysql_connect($server, $user, $pass);
   mysql_select_db($db, $link);
  
   $result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
   DESC,$link);
   $num_rows = mysql_num_rows($result);
  
   if($num_rows) {
   //   print(ptable border=1 align=center);
  while($row = mysql_fetch_row($result))
  
  {
  
 print(tr);
 print(td$row[0]/td);
 print(td$row[1]/td);
 print(td$row[2]/td);
 print(/tr);
  
  
  }
  print(/table/p);
} else {
  print(No Files To Show!!);
  
}
  
   /body
   /html
   ';
  
   $headers  = MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  
   $headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;
  
   mail($to, $subject, $message, $headers);
  
   ?
  
  --
  Raincross Technologies
  Development and Consulting Services
  http://www.raincross-tech.com
 
 
-- 
Raincross Technologies
Development and Consulting Services
http://www.raincross-tech.com



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
Thank you!!  This appears to have solved it...  I didn't even think of using
the $message variable instead of the print()...  Sheesh...  I still have
LOTS to learn!!

Chase


Micah Stevens [EMAIL PROTECTED] wrote in message
1038878012.23696.129.camel@tyrell">news:1038878012.23696.129.camel@tyrell...
 Remember, the print() function sends stuff to the browser. If you wish
 to make the code output to the $message variable, you must use
 additional assignment statements.

 I made some quick changes to the code below, try that:

 ?
 $server = ;
 $user = ;
 $pass = ;
 $db = ;
 $table = ;
 ?

 ?
 $to  = CKnott [EMAIL PROTECTED] . ,  ;
 $to .= Chase [EMAIL PROTECTED];

 $subject = Price File Access History;

 $message = '
 html
 headtitlePrice File Access/title/head

 body
 table border=1 align=center
 tr
 td
   div align=centerbiDate / Time/i/b/div
 /td
 td
   div align=centeribLogged IP Address/b/i/div
 /td
 td
   div align=centeribLogged Username/b/i/div
 /td
 /tr
 ';

 $link = mysql_connect($server, $user, $pass);
 mysql_select_db($db, $link);

 $result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
 DESC,$link);
 $num_rows = mysql_num_rows($result);

 if($num_rows) {
 //   print(ptable border=1 align=center);
while($row = mysql_fetch_row($result))

{

   $message .= tr;
   $message .= td$row[0]/td;
   $message .= td$row[1]/td;
   $message .= td$row[2]/td;
   $message .= /tr;


}
$message .= /table/p;
  } else {
$message .= No Files To Show!!;

  }
 $message .= /body
 /html
 ;

 $headers  = MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;

 $headers .= From: MIC Price File Monitor [EMAIL PROTECTED]\r\n;

 mail($to, $subject, $message, $headers);

 ?



 On Mon, 2002-12-02 at 16:30, Chase wrote:
There is a single quote and semicolon on the line under /html that I
  thought would be defining the end of the assignment.
Should I have used double quotes instead of single?
 
  Chase
 
 
  Micah Stevens [EMAIL PROTECTED] wrote in message
  1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
   There aren't any closing quotes on your $message variable or semicolon
   to tell the parser that you're done with the assignment statement.
  
   -Micah
  
  
  
  
  
   On Mon, 2002-12-02 at 15:05, Chase wrote:
When trying to execute the following script to send the contents of
a
  table
via mail() I am getting this error...
   
Parse error: parse error, unexpected T_STRING in FILENAME.PHP on
line 36
   
The portion of this code inside the HTML tags works great for
displaying
  the
table on the screen, but when I include it in the larger script for
  sending
a mail message, I get this error.
   
I am sure that it is something simple that I have been too stupid to
  catch,
but any help would be great!
   
Chase
   
   
Code Follows  ---
   
?
$server = ;
$user = ;
$pass = ;
$db = ;
$table = ;
?
   
?
$to  = CKnott [EMAIL PROTECTED] . ,  ;
$to .= Chase [EMAIL PROTECTED];
   
$subject = Price File Access History;
   
$message = '
html
headtitlePrice File Access/title/head
   
body
table border=1 align=center
tr
td
  div align=centerbiDate / Time/i/b/div
/td
td
  div align=centeribLogged IP Address/b/i/div
/td
td
  div align=centeribLogged Username/b/i/div
/td
/tr
   
$link = mysql_connect($server, $user, $pass);
mysql_select_db($db, $link);
   
$result = mysql_query(SELECT * FROM $table ORDER BY 'view_date'
DESC,$link);
$num_rows = mysql_num_rows($result);
   
if($num_rows) {
//   print(ptable border=1 align=center);
   while($row = mysql_fetch_row($result))
   
   {
   
  print(tr);
  print(td$row[0]/td);
  print(td$row[1]/td);
  print(td$row[2]/td);
  print(/tr);
   
   
   }
   print(/table/p);
 } else {
   print(No Files To Show!!);
   
 }
   
/body
/html
';
   
$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   
$headers .= From: MIC Price File Monitor
[EMAIL PROTECTED]\r\n;
   
mail($to, $subject, $message, $headers);
   
?
   
   --
   Raincross Technologies
   Development and Consulting Services
   http://www.raincross-tech.com
  
  
 --
 Raincross Technologies
 Development and Consulting Services
 http://www.raincross-tech.com





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




[PHP-DB] Parse error (a bit OT)

2002-02-21 Thread Markus Lervik

Hello,

Can anyone tell me what's wrong with line 68? I get a parse error on
line 68 trying to run this. The strange thing is that it doesn't
complain about line 54. Either I'm blind, stupid, or there's somehing
very wrong here. I've checked above line 67 too, but there doesn't seem
to be any missing brackets or semicolons...

Cheers,
Markus





53: if ($prev_week) {
54:while(date(W,mktime(0,0,0,$m,$d,$Y))==$week) {
...blababla...
}

67: if ($next_week) {
68:while(date(W,mktime(0,0,0,$m,$d,$Y))==$week) {
...blablabla...
}




-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


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




[PHP-DB] Parse error

2002-02-21 Thread Jennifer Downey

Can someone tell me why I am getting a parse error in this little snip?

?

$origVar = 100;
echo POriginal value is $origVar/p;

$origVar += 25;
echo PAdded a value, now it's $origVar/p;

$origVar -= 12;
echo PSubtracted a value, now it's $origVar/p;

$origVar .=  chickens;
echo PFinal answer: $origVar/p;

?

Thanks in advance
Jen Downey



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




RE: [PHP-DB] Parse error

2002-02-21 Thread Cami

try:
?

$origVar = 100;
echo POriginal value is.$origVar./p;

$origVar += 25;
echo PAdded a value, now it's .$origVar./p;

$origVar -= 12;
echo PSubtracted a value, now it's .$origVar./p;

$origVar .=  chickens;
echo PFinal answer: .$origVar./p;

?

Cami

-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 2:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Parse error


Can someone tell me why I am getting a parse error in this little snip?

?

$origVar = 100;
echo POriginal value is $origVar/p;

$origVar += 25;
echo PAdded a value, now it's $origVar/p;

$origVar -= 12;
echo PSubtracted a value, now it's $origVar/p;

$origVar .=  chickens;
echo PFinal answer: $origVar/p;

?

Thanks in advance
Jen Downey



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

2002-02-21 Thread Gurhan Ozen

Hi Jenn,
The code looked ok to me , so I copied and pasted the code you posted and it
worked for me.. Where are you getting the parsing error? Is it the whole
code anyway?

Gurhan


-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Parse error


Can someone tell me why I am getting a parse error in this little snip?

?

$origVar = 100;
echo POriginal value is $origVar/p;

$origVar += 25;
echo PAdded a value, now it's $origVar/p;

$origVar -= 12;
echo PSubtracted a value, now it's $origVar/p;

$origVar .=  chickens;
echo PFinal answer: $origVar/p;

?

Thanks in advance
Jen Downey



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

2002-02-21 Thread jas

I hate to post this again but I have looked in a couple of php and mysql
books but cannot seem to figure this one out.  I am getting a parse error
when trying to use php to delete records from a table.  The error I am
recieving is as follows

Parse error: parse error in /path/to/php/done2.php3 on line 22

Here is the file that is giving me the error, any help would be great... I
think that my problem is that I left out a variable to hold the $cars data
but I am not sure.  Here is the code...

$db_name = test;
$table_name = inventory;
$connection = @mysql_connect(localhost, root, password) or die
(Could
not connect to database.  Please try again later.);
$db = @mysql_select_db($db_name,$connection) or die (Could not select
database table. Please try again later.);
$sql = DELETE FROM $table_name WHERE $cars =
\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
r_num\);
$result = @mysql_query($sql, $connection) or die (Could not execute
query.

Any insight would be great... thanks again.
Jas




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




Re: [PHP-DB] Parse Error

2002-02-21 Thread biorn

Is $cars an array field?  If not, you are trying to compare $cars to an 
list/array of  values (I am not sure this would work even if $cars was an 
array field) 'WHERE $cars 
= $car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dlr
_num\);'.  

Normally, you would have to compare each individual value in each requested 
field to a variable.  
Hard to say without more code.

MB


jas [EMAIL PROTECTED] said:

 I hate to post this again but I have looked in a couple of php and mysql
 books but cannot seem to figure this one out.  I am getting a parse error
 when trying to use php to delete records from a table.  The error I am
 recieving is as follows
 
 Parse error: parse error in /path/to/php/done2.php3 on line 22
 
 Here is the file that is giving me the error, any help would be great... I
 think that my problem is that I left out a variable to hold the $cars data
 but I am not sure.  Here is the code...
 
 $db_name = test;
 $table_name = inventory;
 $connection = @mysql_connect(localhost, root, password) or die
 (Could
 not connect to database.  Please try again later.);
 $db = @mysql_select_db($db_name,$connection) or die (Could not select
 database table. Please try again later.);
 $sql = DELETE FROM $table_name WHERE $cars =
 \$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
 r_num\);
 $result = @mysql_query($sql, $connection) or die (Could not execute
 query.
 
 Any insight would be great... thanks again.
 Jas
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 




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




Re: [PHP-DB] Parse Error

2002-02-21 Thread jas

Here is the code from the file that queries the db and pulls the current
contents of the db and provides a check box form for each record to delete
the items in the db.  I dont know if this will help but like I said before
any insight would be great.  Thanks in advance.
Jas

?php
require '../scripts/db.php';
$result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
execute query, please try again later);
echo table border=\0\ class=\table-body\ width=\100%\form
name=\rem_inv\ method=\post\ action=\done2.php3\
trtd align=\center\ colspan=\3\font size=\4\BCurrent
Inventory/B/fonthr color=\33\/td/tr;
$count = -1;
while ($myrow = mysql_fetch_row($result)) {
$count ++;
echo trtd width=\30%\BType Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_type));
echo /tdtdinput type=\checkbox\ name=\cars\
value=\checkbox\remove/td
/tr\n;
echo trtd width=\30%\BModel Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_model));
echo /td/tr\n;
echo trtd width=\30%\BYear Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_year));
echo /td/tr\n;
echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
printf(mysql_result($result,$count,car_price));
echo /td/tr\n;
echo trtd width=\30%\BVIN Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_vin));
echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
}
echo trtdinput type=\submit\ name=\delete\
value=\delete\/td/tr/form/table;
?

After this file is pulled and the user selects which record to delete it
jumps to the other snippit of code in done2.php3 which is

  $db_name = test;
  $table_name = inventory;
  $connection = @mysql_connect(localhost, root, password) or die
  (Could
  not connect to database.  Please try again later.);
  $db = @mysql_select_db($db_name,$connection) or die (Could not select
  database table. Please try again later.);
  $sql = DELETE FROM $table_name WHERE $cars =
 
\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
  r_num\);
  $result = @mysql_query($sql, $connection) or die (Could not execute
  query.
 
  Any insight would be great... thanks again.
  Jas
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



 --






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




RE: [PHP-DB] Parse Error

2002-02-21 Thread Gurhan Ozen

  Not enough information given to figure out what's going on, but looking at
your query i see:

WHERE $cars =
$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dlr
_num\);

 do you keep 6 different values separated by commas in the field referenced
by $cars??? If this is correct what values you are passing for all those
variables? Is the $cars variable set to a valid column name in the test
table?? What is the data type for the column that $cars references?

Gurhan

-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 12:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Parse Error


I hate to post this again but I have looked in a couple of php and mysql
books but cannot seem to figure this one out.  I am getting a parse error
when trying to use php to delete records from a table.  The error I am
recieving is as follows

Parse error: parse error in /path/to/php/done2.php3 on line 22

Here is the file that is giving me the error, any help would be great... I
think that my problem is that I left out a variable to hold the $cars data
but I am not sure.  Here is the code...

$db_name = test;
$table_name = inventory;
$connection = @mysql_connect(localhost, root, password) or die
(Could
not connect to database.  Please try again later.);
$db = @mysql_select_db($db_name,$connection) or die (Could not select
database table. Please try again later.);
$sql = DELETE FROM $table_name WHERE $cars =
\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
r_num\);
$result = @mysql_query($sql, $connection) or die (Could not execute
query.

Any insight would be great... thanks again.
Jas




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


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




RE: [PHP-DB] Parse Error

2002-02-21 Thread Gurhan Ozen

Jas..
First of all you don't have the variable $cars assigned..
Second of all, we still don't know what the test table looks like? Does it
only have one column with all the infos about cars populated in it???

Gurhan


-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 12:48 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error


Here is the code from the file that queries the db and pulls the current
contents of the db and provides a check box form for each record to delete
the items in the db.  I dont know if this will help but like I said before
any insight would be great.  Thanks in advance.
Jas

?php
require '../scripts/db.php';
$result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
execute query, please try again later);
echo table border=\0\ class=\table-body\ width=\100%\form
name=\rem_inv\ method=\post\ action=\done2.php3\
trtd align=\center\ colspan=\3\font size=\4\BCurrent
Inventory/B/fonthr color=\33\/td/tr;
$count = -1;
while ($myrow = mysql_fetch_row($result)) {
$count ++;
echo trtd width=\30%\BType Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_type));
echo /tdtdinput type=\checkbox\ name=\cars\
value=\checkbox\remove/td
/tr\n;
echo trtd width=\30%\BModel Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_model));
echo /td/tr\n;
echo trtd width=\30%\BYear Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_year));
echo /td/tr\n;
echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
printf(mysql_result($result,$count,car_price));
echo /td/tr\n;
echo trtd width=\30%\BVIN Of Car: /B/tdtd;
printf(mysql_result($result,$count,car_vin));
echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
}
echo trtdinput type=\submit\ name=\delete\
value=\delete\/td/tr/form/table;
?

After this file is pulled and the user selects which record to delete it
jumps to the other snippit of code in done2.php3 which is

  $db_name = test;
  $table_name = inventory;
  $connection = @mysql_connect(localhost, root, password) or die
  (Could
  not connect to database.  Please try again later.);
  $db = @mysql_select_db($db_name,$connection) or die (Could not select
  database table. Please try again later.);
  $sql = DELETE FROM $table_name WHERE $cars =
 
\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
  r_num\);
  $result = @mysql_query($sql, $connection) or die (Could not execute
  query.
 
  Any insight would be great... thanks again.
  Jas
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



 --






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


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




Re: [PHP-DB] Parse Error

2002-02-21 Thread jas

Here is the dump for the cars table...
test (
   id varchar(30) NOT NULL auto_increment,
   car_type varchar(30),
   car_model varchar(30),
   car_year varchar(15),
   car_price varchar(15),
   car_vin varchar(25),
   dlr_num varchar(25),
   PRIMARY KEY (id),
   KEY id (id)
test VALUES ('1', 'Ford', 'Bronco', '1969', '4500', 'vin897655', 'none');

Sorry about that... still a bit of a newbie here. =)
Jas

Gurhan Ozen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jas..
 First of all you don't have the variable $cars assigned..
 Second of all, we still don't know what the test table looks like? Does
it
 only have one column with all the infos about cars populated in it???

 Gurhan


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 21, 2002 12:48 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Parse Error


 Here is the code from the file that queries the db and pulls the current
 contents of the db and provides a check box form for each record to delete
 the items in the db.  I dont know if this will help but like I said before
 any insight would be great.  Thanks in advance.
 Jas

 ?php
 require '../scripts/db.php';
 $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
 execute query, please try again later);
 echo table border=\0\ class=\table-body\ width=\100%\form
 name=\rem_inv\ method=\post\ action=\done2.php3\
 trtd align=\center\ colspan=\3\font size=\4\BCurrent
 Inventory/B/fonthr color=\33\/td/tr;
 $count = -1;
 while ($myrow = mysql_fetch_row($result)) {
 $count ++;
 echo trtd width=\30%\BType Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_type));
 echo /tdtdinput type=\checkbox\ name=\cars\
 value=\checkbox\remove/td
 /tr\n;
 echo trtd width=\30%\BModel Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_model));
 echo /td/tr\n;
 echo trtd width=\30%\BYear Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_year));
 echo /td/tr\n;
 echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
 printf(mysql_result($result,$count,car_price));
 echo /td/tr\n;
 echo trtd width=\30%\BVIN Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_vin));
 echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
 }
 echo trtdinput type=\submit\ name=\delete\
 value=\delete\/td/tr/form/table;
 ?

 After this file is pulled and the user selects which record to delete it
 jumps to the other snippit of code in done2.php3 which is

   $db_name = test;
   $table_name = inventory;
   $connection = @mysql_connect(localhost, root, password) or die
   (Could
   not connect to database.  Please try again later.);
   $db = @mysql_select_db($db_name,$connection) or die (Could not
select
   database table. Please try again later.);
   $sql = DELETE FROM $table_name WHERE $cars =
  

\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
   r_num\);
   $result = @mysql_query($sql, $connection) or die (Could not execute
   query.
  
   Any insight would be great... thanks again.
   Jas
  
  
  
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 
  --
 
 
 



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




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




RE: [PHP-DB] Parse Error

2002-02-21 Thread Gurhan Ozen

Ok then it sure will not work.. because you have :

DELETE FROM $table_name WHERE $cars
=\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$d
lr_num\);

1- $cars is set to the value checkbox which doesn't exist in your test
table
2- The end of the statement $dlr_num\);  is not right , that
parenthesis isn't supposed to be there
3- The delete statement is wrong...You are storing all that info in the
separate fields but you are giving all combined as a condition in only one
field ($cars).
3- Rewrite your delete statement to delete the rows identified by the id
column as DELETE FROM $table WHERE id ='id'; Of course in the page where
you list the cars to be deleted associate each checkbox with the car's id.

Hope this helps..

Gurhan


-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 1:02 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error


Here is the dump for the cars table...
test (
   id varchar(30) NOT NULL auto_increment,
   car_type varchar(30),
   car_model varchar(30),
   car_year varchar(15),
   car_price varchar(15),
   car_vin varchar(25),
   dlr_num varchar(25),
   PRIMARY KEY (id),
   KEY id (id)
test VALUES ('1', 'Ford', 'Bronco', '1969', '4500', 'vin897655', 'none');

Sorry about that... still a bit of a newbie here. =)
Jas

Gurhan Ozen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jas..
 First of all you don't have the variable $cars assigned..
 Second of all, we still don't know what the test table looks like? Does
it
 only have one column with all the infos about cars populated in it???

 Gurhan


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 21, 2002 12:48 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Parse Error


 Here is the code from the file that queries the db and pulls the current
 contents of the db and provides a check box form for each record to delete
 the items in the db.  I dont know if this will help but like I said before
 any insight would be great.  Thanks in advance.
 Jas

 ?php
 require '../scripts/db.php';
 $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
 execute query, please try again later);
 echo table border=\0\ class=\table-body\ width=\100%\form
 name=\rem_inv\ method=\post\ action=\done2.php3\
 trtd align=\center\ colspan=\3\font size=\4\BCurrent
 Inventory/B/fonthr color=\33\/td/tr;
 $count = -1;
 while ($myrow = mysql_fetch_row($result)) {
 $count ++;
 echo trtd width=\30%\BType Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_type));
 echo /tdtdinput type=\checkbox\ name=\cars\
 value=\checkbox\remove/td
 /tr\n;
 echo trtd width=\30%\BModel Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_model));
 echo /td/tr\n;
 echo trtd width=\30%\BYear Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_year));
 echo /td/tr\n;
 echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
 printf(mysql_result($result,$count,car_price));
 echo /td/tr\n;
 echo trtd width=\30%\BVIN Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_vin));
 echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
 }
 echo trtdinput type=\submit\ name=\delete\
 value=\delete\/td/tr/form/table;
 ?

 After this file is pulled and the user selects which record to delete it
 jumps to the other snippit of code in done2.php3 which is

   $db_name = test;
   $table_name = inventory;
   $connection = @mysql_connect(localhost, root, password) or die
   (Could
   not connect to database.  Please try again later.);
   $db = @mysql_select_db($db_name,$connection) or die (Could not
select
   database table. Please try again later.);
   $sql = DELETE FROM $table_name WHERE $cars =
  

\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
   r_num\);
   $result = @mysql_query($sql, $connection) or die (Could not execute
   query.
  
   Any insight would be great... thanks again.
   Jas
  
  
  
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 
  --
 
 
 



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




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

2002-02-21 Thread jas

Could you maybe give me an example of how to associate the checkbox with the
id?  Thanks again,
Jas
Gurhan Ozen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Ok then it sure will not work.. because you have :

 DELETE FROM $table_name WHERE $cars

=\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$d
 lr_num\);

 1- $cars is set to the value checkbox which doesn't exist in your test
 table
 2- The end of the statement $dlr_num\);  is not right , that
 parenthesis isn't supposed to be there
 3- The delete statement is wrong...You are storing all that info in the
 separate fields but you are giving all combined as a condition in only one
 field ($cars).
 3- Rewrite your delete statement to delete the rows identified by the id
 column as DELETE FROM $table WHERE id ='id'; Of course in the page where
 you list the cars to be deleted associate each checkbox with the car's id.

 Hope this helps..

 Gurhan


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 21, 2002 1:02 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Parse Error


 Here is the dump for the cars table...
 test (
id varchar(30) NOT NULL auto_increment,
car_type varchar(30),
car_model varchar(30),
car_year varchar(15),
car_price varchar(15),
car_vin varchar(25),
dlr_num varchar(25),
PRIMARY KEY (id),
KEY id (id)
 test VALUES ('1', 'Ford', 'Bronco', '1969', '4500', 'vin897655', 'none');

 Sorry about that... still a bit of a newbie here. =)
 Jas

 Gurhan Ozen [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Jas..
  First of all you don't have the variable $cars assigned..
  Second of all, we still don't know what the test table looks like?
Does
 it
  only have one column with all the infos about cars populated in it???
 
  Gurhan
 
 
  -Original Message-
  From: jas [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, February 21, 2002 12:48 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Parse Error
 
 
  Here is the code from the file that queries the db and pulls the current
  contents of the db and provides a check box form for each record to
delete
  the items in the db.  I dont know if this will help but like I said
before
  any insight would be great.  Thanks in advance.
  Jas
 
  ?php
  require '../scripts/db.php';
  $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
  execute query, please try again later);
  echo table border=\0\ class=\table-body\ width=\100%\form
  name=\rem_inv\ method=\post\ action=\done2.php3\
  trtd align=\center\ colspan=\3\font size=\4\BCurrent
  Inventory/B/fonthr color=\33\/td/tr;
  $count = -1;
  while ($myrow = mysql_fetch_row($result)) {
  $count ++;
  echo trtd width=\30%\BType Of Car: /B/tdtd;
  printf(mysql_result($result,$count,car_type));
  echo /tdtdinput type=\checkbox\ name=\cars\
  value=\checkbox\remove/td
  /tr\n;
  echo trtd width=\30%\BModel Of Car: /B/tdtd;
  printf(mysql_result($result,$count,car_model));
  echo /td/tr\n;
  echo trtd width=\30%\BYear Of Car: /B/tdtd;
  printf(mysql_result($result,$count,car_year));
  echo /td/tr\n;
  echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
  printf(mysql_result($result,$count,car_price));
  echo /td/tr\n;
  echo trtd width=\30%\BVIN Of Car: /B/tdtd;
  printf(mysql_result($result,$count,car_vin));
  echo /td/trtrtd colspan=\3\hr
color=\33\/td/tr\n;
  }
  echo trtdinput type=\submit\ name=\delete\
  value=\delete\/td/tr/form/table;
  ?
 
  After this file is pulled and the user selects which record to delete it
  jumps to the other snippit of code in done2.php3 which is
 
$db_name = test;
$table_name = inventory;
$connection = @mysql_connect(localhost, root, password) or die
(Could
not connect to database.  Please try again later.);
$db = @mysql_select_db($db_name,$connection) or die (Could not
 select
database table. Please try again later.);
$sql = DELETE FROM $table_name WHERE $cars =
   
 

\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
r_num\);
$result = @mysql_query($sql, $connection) or die (Could not execute
query.
   
Any insight would be great... thanks again.
Jas
   
   
   
   
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
  
  
   --
  
  
  
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



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

2002-02-21 Thread biorn

According to your code, if the checkbox next to the word 'remove' is checked, 
then the value of $cars passed to the form is checkbox.  Then in the 
done2.php3 page, you are trying to delete where checkbox='array of values 
listed'.  
Is there a field in your database called checkbox?  If so, what field type is 
it set to?  If not, there is your problem.

HTH
MB  

jas [EMAIL PROTECTED] said:

 Here is the code from the file that queries the db and pulls the current
 contents of the db and provides a check box form for each record to delete
 the items in the db.  I dont know if this will help but like I said before
 any insight would be great.  Thanks in advance.
 Jas
 
 ?php
 require '../scripts/db.php';
 $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
 execute query, please try again later);
 echo table border=\0\ class=\table-body\ width=\100%\form
 name=\rem_inv\ method=\post\ action=\done2.php3\
 trtd align=\center\ colspan=\3\font size=\4\BCurrent
 Inventory/B/fonthr color=\33\/td/tr;
 $count = -1;
 while ($myrow = mysql_fetch_row($result)) {
 $count ++;
 echo trtd width=\30%\BType Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_type));
 echo /tdtdinput type=\checkbox\ name=\cars\
 value=\checkbox\remove/td
 /tr\n;
 echo trtd width=\30%\BModel Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_model));
 echo /td/tr\n;
 echo trtd width=\30%\BYear Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_year));
 echo /td/tr\n;
 echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
 printf(mysql_result($result,$count,car_price));
 echo /td/tr\n;
 echo trtd width=\30%\BVIN Of Car: /B/tdtd;
 printf(mysql_result($result,$count,car_vin));
 echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n;
 }
 echo trtdinput type=\submit\ name=\delete\
 value=\delete\/td/tr/form/table;
 ?
 
 After this file is pulled and the user selects which record to delete it
 jumps to the other snippit of code in done2.php3 which is
 
   $db_name = test;
   $table_name = inventory;
   $connection = @mysql_connect(localhost, root, password) or die
   (Could
   not connect to database.  Please try again later.);
   $db = @mysql_select_db($db_name,$connection) or die (Could not select
   database table. Please try again later.);
   $sql = DELETE FROM $table_name WHERE $cars =
  
 \$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dl
   r_num\);
   $result = @mysql_query($sql, $connection) or die (Could not execute
   query.
  
   Any insight would be great... thanks again.
   Jas
  
  
  
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 
  --
 
 
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 




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




[PHP-DB] parse error

2002-02-02 Thread M . E . Paul

I'm working through the New Riders MySQL book and I get the following error
when running a php script, can someone help? Thanks, Matt - 

Parse error: parse error in c:\program files\apache
group\apache\htdocs\genesis\dump_info.php on line 25


Here's lines 25 - 

printf (TD%s/TD\n, htmlspecialchars ($row[$i]));

Here's the full code if that helps - 

?php
# dump_names.php - dump Genesis info

include (genesis.inc);

$title = Genesis info list;
html_begin ($title, $title);

genesis_connect ()
or die (Cannot connect to server);

# issue query
$query = SELECT collector_material, name, description, coating, size FROM
mp ORDER BY name;
$result = mysql_query ($query)
or die (Cannot execute query);

print (TABLE\n);
# read results of query, then clean up
while ($row = mysql_fetch_row ($result))
{
print (TR\n);
for ($i = 0; $i  mysql_num_fields ($result); $i++)
{
# escape any special characters and print
printf (TD%s/TD\n, htmlspecialchars ($row[$i]));
}
print (/TR\n);
}
mysql_free_result ($result);
print (/TABLE\n);

html_end ();

?

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

2001-12-14 Thread matt stewart

the way to start this is to just add a couple of letters to the message and
see if you're still getting an error - 
try (on line 357)...

$message .=nobr\nHello world;
keep it all on one line, and then see if you're still getting an error - if
you are then i don't think this line is the one you have to worry about!

-Original Message-
From: Rob Day [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2001 21:49
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] parse error


I've written a small script that processes a form from a webpage and sends
the submitted data as an HTML e-mail that has the form all filled out
already. I've gotten smaller versions of this script to work without any
problem just to test the idea.I can't figure out why I'm now getting the
following error:
Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
on line 358

Here is the offending code:
353 if ($moderation == no){
354 $message .=  checked;
355 }
356
357$message .= '
358nobr
359pAnswer yes if you want all postings to the list to be
sent to 
360  a moderator for approval before distribution to the
list./p

Any help would be greatly appreciated. Thanks!

Rob Day
Web Team Leader
Texas State Library and Archives Commission
phone: 512.936.4463   fax: 512.463.5436
[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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

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

2001-12-14 Thread +markus lervik

On Thu, 2001-12-13 at 23:49, Rob Day wrote:

As far as I can see, you're missing '; in line 360, unless it continues
further down and terminates the $message string there.
 
 Here is the offending code:
 353   if ($moderation == no){
 354   $message .=  checked;
 355   }
 356
 357$message .= '
 358nobr
 359pAnswer yes if you want all postings to the list to be
 sent to 
 360  a moderator for approval before distribution to the
 list./p
 
 Any help would be greatly appreciated. Thanks!

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


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

2001-12-13 Thread Daniel Barton

Rob -

I think I see what you're doing: you're concatenating $message with something
else (the HTML output following line 357?). Problem is, you're just stating
the right hand side of what should be an assignment. The concatenation should
be:

$variable = $variable .= 'HTML output';

and it looks like you just have

$variable .= 'HTML output';

although you didn't post enough code for me to be sure of this.

If you didn't mean to concatenate something, trying taking the dot before the
equal sign out of the statement.

If I'm completely wrong as to what you're trying to do, apologies.

cheers,
db

Rob Day wrote:

 I've written a small script that processes a form from a webpage and sends
 the submitted data as an HTML e-mail that has the form all filled out
 already. I've gotten smaller versions of this script to work without any
 problem just to test the idea.I can't figure out why I'm now getting the
 following error:
 Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
 on line 358

 Here is the offending code:
 353 if ($moderation == no){
 354 $message .=  checked;
 355 }
 356
 357$message .= '
 358nobr
 359pAnswer yes if you want all postings to the list to be
 sent to
 360  a moderator for approval before distribution to the
 list./p

 Any help would be greatly appreciated. Thanks!
 
 Rob Day
 Web Team Leader
 Texas State Library and Archives Commission
 phone: 512.936.4463   fax: 512.463.5436
 [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]

--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[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] parse-error MySQL - PhP @ win2000

2001-11-10 Thread Jelle Ferwerda

Hi all,

I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I 
know, I should be running linux; That will have to come with time). But now I am 
trying to learn PhP - MySQL. When running the script below I get the error message:

Parse error: parse error in c:\phpdev\www\public\test2.php on line 25


Is there anybody who knows what the problem might be? I think is in the result display 
part, considering how things run properly when I leave it out. Hopefully you ca get me 
going, since I do not know what I am doing wrong!!

Thanks for the help,

Jelle


?
$host=localhost; 
$username=;
$password=;
$database=jelle_test;
$table=pet;


$db = mysql_connect($host)
  or die (verbinding maken met de server is mislukt);
Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db;

  @mysql_select_db($database, $db)
or die (Helaas geen verbinding kunnen maken met de database);

$sql_select = Select * from pet;
$result = mysql_query($sql_select, $db);
if($result) {
  echo Selectie succesvol;
  while ( $resultaat = mysql_fetch_row($result)) {
  printf($resultaat[0]);
}

mysql_close($db);
?


-- 


**
Ir. Jelle G. Ferwerda
[EMAIL PROTECTED] - www.bio-vision.nl
**
Mankind:
Intelligent enough to make a strong impact on the environment,
But not strong enough to make an intelligent one!
**


**
Ir. Jelle G. Ferwerda
[EMAIL PROTECTED] - www.bio-vision.nl
**
Mankind:
Intelligent enough to make a strong impact on the environment,
But not strong enough to make an intelligent one!
**



Re: [PHP-DB] parse-error MySQL - PhP @ win2000

2001-11-10 Thread Roel Mulder

Dag Jelle,
Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou 
het goed moeten gaan.

Dus regel 24 wordt:   print ($resultaat[0]);

(Excuse me muttering Dutch between the two of us :)

M.vr.gr.
Roel Mulder

At 21:32 10-11-2001 +0100, you wrote:
Hi all,

I have recently installed an apache server, PhP4 and MySql on my win2000 
machine (I know, I should be running linux; That will have to come with 
time). But now I am trying to learn PhP - MySQL. When running the script 
below I get the error message:

Parse error: parse error in c:\phpdev\www\public\test2.php on line 25


Is there anybody who knows what the problem might be? I think is in the 
result display part, considering how things run properly when I leave it 
out. Hopefully you ca get me going, since I do not know what I am doing wrong!!

Thanks for the help,

Jelle


?
$host=localhost;
$username=;
$password=;
$database=jelle_test;
$table=pet;


$db = mysql_connect($host)
   or die (verbinding maken met de server is mislukt);
Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db;

   @mysql_select_db($database, $db)
 or die (Helaas geen verbinding kunnen maken met de database);

$sql_select = Select * from pet;
$result = mysql_query($sql_select, $db);
if($result) {
   echo Selectie succesvol;
   while ( $resultaat = mysql_fetch_row($result)) {
   printf($resultaat[0]);
}

mysql_close($db);
?


--


**
Ir. Jelle G. Ferwerda
[EMAIL PROTECTED] - www.bio-vision.nl

Mulder Technisch Advies
Postbus 69
NL-2740 AB  WADDINXVEEN
tel. 0182-640184 fax. 0182-640185
http://www.mta.nl


-- 
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] parse-error MySQL - PhP @ win2000

2001-11-10 Thread DL Neil

Hi Jelle,

- Original Message -
I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I 
know, I should be running
linux; That will have to come with time). But now I am trying to learn PhP - MySQL. 
When running the script
below I get the error message:

Parse error: parse error in c:\phpdev\www\public\test2.php on line 25

Is there anybody who knows what the problem might be? I think is in the result display 
part, considering how
things run properly when I leave it out. Hopefully you ca get me going, since I do not 
know what I am doing
wrong!!

Thanks for the help,

Jelle


?
$host=localhost;
$username=;
$password=;
$database=jelle_test;
$table=pet;


$db = mysql_connect($host)
  or die (verbinding maken met de server is mislukt);
Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db;

  @mysql_select_db($database, $db)
or die (Helaas geen verbinding kunnen maken met de database);

$sql_select = Select * from pet;
$result = mysql_query($sql_select, $db);
if($result) {
  echo Selectie succesvol;
  while ( $resultaat = mysql_fetch_row($result)) {
  printf($resultaat[0]);
}

mysql_close($db);
?


=an error message that quotes a line number AFTER the end of the script indicates that 
some entity has been
opened but not closed. In this case curly brackets.

=Various source code formatting conventions exist to try to avoid the situation (that 
we have here) where the
appearance of the source code works to deceive brain and eye. There has been some 
debate in PHP forums about the
'best' way (FWIW my opinion: whatever works=best), and this is an excellent 
illustration of why coding the
opening bracket of a code block this way, may not be best way! The code-block 
indentation is not consistent
which further disguises the omission.

=Regards,
=dn



-- 
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] parse-error MySQL - PhP @ win2000

2001-11-10 Thread Jelle Ferwerda

Thanks very much for the assistence: The curly-bracket thing did it! Now I
finally know the installation has been succesfull!

I'll try to start programming less sloppy, and spare you from these silly
errors!

I'll notify you when the site is up and running. Future site location:
www.hyperspectral.info

J.


**
Ir. Jelle G. Ferwerda
[EMAIL PROTECTED] - www.bio-vision.nl
**
Mankind:
Intelligent enough to make a strong impact on the environment,
But not strong enough to make an intelligent one!
**

- Original Message -
From: Roel Mulder [EMAIL PROTECTED]
To: Jelle Ferwerda [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, November 10, 2001 10:39 PM
Subject: Re: [PHP-DB] parse-error MySQL - PhP @ win2000


 Dag Jelle,
 Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou
 het goed moeten gaan.

 Dus regel 24 wordt:   print ($resultaat[0]);

 (Excuse me muttering Dutch between the two of us :)

 M.vr.gr.
 Roel Mulder

 At 21:32 10-11-2001 +0100, you wrote:
 Hi all,
 
 I have recently installed an apache server, PhP4 and MySql on my win2000
 machine (I know, I should be running linux; That will have to come with
 time). But now I am trying to learn PhP - MySQL. When running the script
 below I get the error message:
 
 Parse error: parse error in c:\phpdev\www\public\test2.php on line 25
 
 
 Is there anybody who knows what the problem might be? I think is in the
 result display part, considering how things run properly when I leave it
 out. Hopefully you ca get me going, since I do not know what I am doing
wrong!!
 
 Thanks for the help,
 
 Jelle
 
 
 ?
 $host=localhost;
 $username=;
 $password=;
 $database=jelle_test;
 $table=pet;
 
 
 $db = mysql_connect($host)
or die (verbinding maken met de server is mislukt);
 Echo gefeliciteerd, de verbinding is tot stand gebracht, de handle is
$db;
 
@mysql_select_db($database, $db)
  or die (Helaas geen verbinding kunnen maken met de database);
 
 $sql_select = Select * from pet;
 $result = mysql_query($sql_select, $db);
 if($result) {
echo Selectie succesvol;
while ( $resultaat = mysql_fetch_row($result)) {
printf($resultaat[0]);
 }
 
 mysql_close($db);
 ?
 
 
 --
 
 
 **
 Ir. Jelle G. Ferwerda
 [EMAIL PROTECTED] - www.bio-vision.nl

 Mulder Technisch Advies
 Postbus 69
 NL-2740 AB  WADDINXVEEN
 tel. 0182-640184 fax. 0182-640185
 http://www.mta.nl


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

2001-03-13 Thread paauwe

what is a parse error?