Re: [PHP] Error in variable when looping

2003-01-14 Thread menezesd

Sorry Rick. Thanks.

I could not understand your question. Are you asking for more of the code? I did not 
include that as I thought it would be too long in the mail.

Thanks
Denis

--- Rick Emery [EMAIL PROTECTED] wrote:

 so where is $rowe set?
 
 Show us code that calls this page
 - Original Message -
 From: menezesd [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, January 13, 2003 6:21 PM
 Subject: [PHP] Error in variable when looping
 
 
 Hello friends,
 
 I have made the following table of data and a button on every row to
 view the details. The code is
 working fine and the table is displayed with the buttons.
 
 The problem I have is that the $SelectedItemNumber posted to the
 next page remains the same number
 no matter which row button I click. I have my relevant code below.
 Please help me. I know I am
 making a mistake somewhere but I cannot figure out where.
 
 Quote :
 
 
 while($row=mysql_fetch_array($result)){
 
 Print  tr ;
 Print td width=\12%\ align=\center\ height=\6\
 bgcolor=\#bf\font face=\Tahoma\
 color=\#00\ ;
 Print   b font size=\2\ color=\ff\ $row[OrgName]
 /b/font;
 print /font  nbsp;/td;
 Print td width=\12%\ align=\center\ height=\6\
 bgcolor=\#bf\font size=\2\
 face=\Tahoma\ color=\#00\ ;
 Print  $row[OrgCountry];
 print /font  nbsp;/td;
 Print td width=\12%\ align=\center\ height=\6\
 bgcolor=\#bf\font size=\2\
 face=\Tahoma\ color=\#00\ ;
 Print  $row[OrgNumber];
 print /font  nbsp;/td;
 Print td width=\12%\ align=\center\ height=\6\
 bgcolor=\#bf\font size=\2\
 face=\Tahoma\ color=\#00\ ;
 Print  $row[Orgaddress];
 print /font  nbsp;/td;
 Print td width=\12%\ align=\center\ height=\6\
 bgcolor=\#bf\font size=\2\
 face=\Tahoma\ color=\#00\ ;
 Print  $row[OrgChief];
 print /font  nbsp;/td;
 Print td width=\12%\ align=\center\ height=\6\
 bgcolor=\#b7b700\font size=\2\
 face=\Tahoma\ color=\#00\ ;
 PrintINPUT TYPE=\submit\ value=\View details\
 Name=\Details\;
 print /td;
 Printinput type=\hidden\ name=\SelectedItemNumber\ value=
 $row[Id];
   Print /tr;}
   }
 ?
 
 
 
 Unquote
 
 Thanks
 Denis
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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




[PHP] Calendar problem

2003-01-14 Thread menezesd

Hello friends.

I have two fields in my form. When two dates are entered in these two boxes, I need to 
find the diiference in calendar months and remaining days between these two dates. 
This Calendar months and remaining days is important. The functions that I know do 
not work for calendar months.
Can anyone help me and tell me how this could be achieved and are there any PHP 
functions to do this?

best regards
Denis

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




[PHP] Error in variable when looping

2003-01-13 Thread menezesd
Hello friends,

I have made the following table of data and a button on every row to view the details. 
The code is working fine and the table is displayed with the buttons. 

The problem I have is that the $SelectedItemNumber posted to the next page remains the 
same number no matter which row button I click. I have my relevant code below. Please 
help me. I know I am making a mistake somewhere but I cannot figure out where.

Quote :


while($row=mysql_fetch_array($result)){ 

Print  tr ;
Print td width=\12%\ align=\center\ height=\6\ bgcolor=\#bf\font 
face=\Tahoma\ color=\#00\ ;
Print   b font size=\2\ color=\ff\ $row[OrgName] /b/font;
print /font  nbsp;/td;
Print td width=\12%\ align=\center\ height=\6\ 
bgcolor=\#bf\font size=\2\ face=\Tahoma\ color=\#00\ ;
Print  $row[OrgCountry]; 
print /font  nbsp;/td;
Print td width=\12%\ align=\center\ height=\6\ 
bgcolor=\#bf\font size=\2\ face=\Tahoma\ color=\#00\ ;
Print  $row[OrgNumber]; 
print /font  nbsp;/td;
Print td width=\12%\ align=\center\ height=\6\ 
bgcolor=\#bf\font size=\2\ face=\Tahoma\ color=\#00\ ;
Print  $row[Orgaddress]; 
print /font  nbsp;/td;
Print td width=\12%\ align=\center\ height=\6\ 
bgcolor=\#bf\font size=\2\ face=\Tahoma\ color=\#00\ ;
Print  $row[OrgChief]; 
print /font  nbsp;/td;
Print td width=\12%\ align=\center\ height=\6\ bgcolor=\#b7b700\font 
size=\2\ face=\Tahoma\ color=\#00\ ;
PrintINPUT TYPE=\submit\ value=\View details\ Name=\Details\;
print /td;
Printinput type=\hidden\ name=\SelectedItemNumber\ value= $row[Id];
  Print /tr;}
  }
?



Unquote

Thanks
Denis

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




[PHP] Formatting text output

2002-12-25 Thread menezesd
Hello friends.

I work for a school where we need to put the class results on to our web, one for 
every class. We enter the marks in the database and this should be displayed in a 
particular varying format as follows(an example) :

Grade A Pass :
4554 7687 9834 2354 7671

Grade B Pass :
0045 7612 2297

Failed :
3104 6509 0286 8765 2229 0978

How can I put this in Mysql and get the same test formatting out? If the grade types 
where standard and limited, it was okay. But the grades types can increase or 
decrease. How can I maintain the same formatting as what I input?

Thanks very much
Denis

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




[PHP] Need some help please

2002-04-01 Thread menezesd

Hello Friends.

I know I am asking for too much. But somehow, I am stuck 
with three books I am refering and still not being able to 
solve my problem, which I would greatly appreciate if any 
of you gurus can assist. The problem is as follows :

I have three sections in this mail :
1. My table structure
2. My test.html file whose ACTION is testphp1.php file
3. My testphp1.php file.

The problem is that I keep getting the error error adding 
rows as the rows are not adding in the database.

My table structure :

Table name : news
Fields :
newsid INT(11) 
title carchar(100)
author varchar(40)
posted INT(11)
body MEDIUMTEXT


My test.htm file :
==
html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; 
charset=iso-8859-1

/head

body bgcolor=#FF text=#00
form name=form1 method=post action=testphp1.php
  p
input type=text name=newsid
  /p
  p 
input type=text name=title
  /p
  p 
input type=text name=author
  /p
  p 
input type=text name=body
  /p
  p 
input type=submit name=Submit value=Submit
  /p
  /form
/body



/html


My testphp1.php file :
==

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; 
charset=iso-8859-1

/head

body bgcolor=#FF text=#00
?
$link=mysql_connect(localhost,menezesd,FX3PYTys);
if ($link){
print link id is $link;
} else {
print error connecting to database;
}
$posted=time();

$query=INSERT INTO 'news' 
('newsid','title','author', 'posted', 'body')
 VALUES($newsid,'$title','$author',$posted,'$body' );
 print ($query);
 
IF (mysql_query($query)){
  print Row added to table;
 } else {
 print error adding row;
 }
 mysql_close($link);
  ?

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