[PHP-DB] printing an array

2002-10-24 Thread Chris Grigor
Hey there all


Im sure that someone out there can answer this question..

I have a problem, how can I print each element in an array so that is
returned into a table?


eg
table width=100%
th width=25% nowrap
Test1
/th
th width=25% nowrap
Test2
/th
th width=25% nowrap
Test3
/th
th width=25%
Test4
/th

?php
include(common.inc);
$link_id = mysql_connect($dbhost, $username, $password)
or die (Connection Failed);

mysql_select_db($db);
$query = select Routine_Tests_Count from CDT_Routine_Tests where Ref_num =
'$ref_num'
order by Routine_Tests_Link;

$result = mysql_query($query, $link_id)
or die (Query on $dbhost failed);

while ($row = mysql_fetch_object($result)) {
print td$row-CDT_Routine_Count/td;--- (This
value holds the Results of test1 test 2 etc
   
 that I need to print into the table)
}
mysql_free_result($result);

?
/table

Any help with this or direction would be appreciated !

Regards
Chris



--
Chris Grigor
--



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




[PHP-DB] Duplicates

2002-10-23 Thread Chris Grigor
Howdi all,

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

select Date from table_name where name = 'Test';


|Date|

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

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

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

Any help would be appreciated

Many Thanks guys





--
Chris Grigor

Calibre Clinical Consultants

--



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




RE: [PHP-DB] Re: onnecting to MSSQL database from Linux?

2002-09-26 Thread Chris Grigor

I have got a copy of ctllib-linux-elf.tgz as it says on the php website, but
I need another file called
devlib.tgz.
Anyone know where I can get a copy from???


Chris



-Original Message-
From: Avi Schwartz [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2002 02:44
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: onnecting to MSSQL database from Linux?


I did build it with --with-sybase, but then I forgot to install the new
version.  Face turning red...  Sorry for the false alarm.  It now works
like a charm.

Avi

Adam Williams wrote:

 He's using microsoft sql server, not mysql.

 try --with-mssql

 On Wed, 18 Sep 2002, Jason Morehouse wrote:

 It means you haven't compiled mysql support into php.  Recompile it using
 --with-mysql
 On Tue, 17 Sep 2002 15:30:29 +, Avi Schwartz wrote:

  I have PHP4 and freetds installed and I am trying to connect to a mssql
  server.  The problem I am having is that the mssql_connect() call
  generates the following error:
 
  Fatal error: Call to undefined function: mssql_connect()
--
Avi Schwartz   Universe-watching, like golf and aging,
[EMAIL PROTECTED] promotes humility - William R. Everdell

--
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] Conversion from access to mysql

2002-09-10 Thread Chris Grigor

Hey there all

This is more than likely a common question, anyone have any guidelines, do's
or dont's
about converting an access db to mysql db...

Regards

Chris


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




RE: [PHP-DB] Re: output problem

2002-05-24 Thread Chris Grigor

ah hah someone got it right !! many thanks stephen ...



-Original Message-
From: Stephen Rhodes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 8:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: output problem


When you write the SQL statement write it as:
select count(user) AS count from log_request where date='$date' and
status = 'open'
(note i have added 'AS count' in there so it stores the value in
'count')

Now when you output the result write it as $line-count

Cheers
Steve

Chris Grigor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Howdi Alll

some of you might laugh at this but I cant get this to work
Im doing a count on a field and want to diplay the result here is an
example...


?php
#error_reporting(E_ALL);
echo date(Y-m-d);
print $date;
mysql_connect(servername, user, password)
or die(Connect failed);

$query = select count(user) from log_request where date='$date' and
status = 'open';
$result = mysql_db_query(call_manage, $query)
or die(query failed);


while($line = mysql_fetch_object($result))
{
print (table width=100% border=0tdtr bgcolor=#f0f0f0);
print (brb /b$line-userbr\n);
print (/td/tr);
}
?



what am I missing as it returns no value at all from $line-user, should I
be
doing this differently??

Thankyou

Chris



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

2002-05-23 Thread Chris Grigor

Howdi Alll 

some of you might laugh at this but I cant get this to work
Im doing a count on a field and want to diplay the result here is an 
example...


?php
#error_reporting(E_ALL);
echo date(Y-m-d);
print $date;
mysql_connect(servername, user, password)
or die(Connect failed);

$query = select count(user) from log_request where date='$date' and status = 
'open';
$result = mysql_db_query(call_manage, $query)
or die(query failed);


while($line = mysql_fetch_object($result))
{
print (table width=100% border=0tdtr bgcolor=#f0f0f0);
print (brb /b$line-userbr\n);
print (/td/tr);
}
?



what am I missing as it returns no value at all from $line-user, should I be 
doing this differently??

Thankyou 

Chris

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




[PHP-DB] output problem

2002-05-23 Thread Chris Grigor

Howdi Alll 

some of you might laugh at this but I cant get this to work
Im doing a count on a field and want to diplay the result here is an 
example...


?php
#error_reporting(E_ALL);
echo date(Y-m-d);
print $date;
mysql_connect(servername, user, password)
or die(Connect failed);

$query = select count(user) from log_request where date='$date' and status = 
'open';
$result = mysql_db_query(call_manage, $query)
or die(query failed);


while($line = mysql_fetch_object($result))
{
print (table width=100% border=0tdtr bgcolor=#f0f0f0);
print (brb /b$line-userbr\n);
print (/td/tr);
}
?



what am I missing as it returns no value at all from $line-user, should I be 
doing this differently??

Thankyou 

Chris

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




[PHP-DB] output problem

2002-05-23 Thread Chris Grigor

Howdi Alll 

some of you might laugh at this but I cant get this to work
Im doing a count on a field and want to diplay the result here is an 
example...


?php
#error_reporting(E_ALL);
echo date(Y-m-d);
print $date;
mysql_connect(servername, user, password)
or die(Connect failed);

$query = select count(user) from log_request where date='$date' and status = 
'open';
$result = mysql_db_query(call_manage, $query)
or die(query failed);


while($line = mysql_fetch_object($result))
{
print (table width=100% border=0tdtr bgcolor=#f0f0f0);
print (brb /b$line-userbr\n);
print (/td/tr);
}
?



what am I missing as it returns no value at all from $line-user, should I be 
doing this differently??

Thankyou 

Chris

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




[PHP-DB] error

2002-05-07 Thread Chris Grigor

Howdi guys 

any help on this would be greatful

I have a page that submits to this script with a value of search

but when I submit it gives me an error Parse error: parse error in 
/var/www/html/ul/mysql_fetch_array.php on line 11 
anyhelp here would be greatful, I dont see what the error could be 

Thanks

Chris


?php

mysql_connect(localhost, username, password) or
die(couldnt connect);
mysql_select_db(call_manage);

$query = SELECT company_name, ticket_id, date from log_request where 
company_name like '%$search%';
$result = mysql_query($query);

while (($row = mysql_fetch_array($result, MYSQL_ASSOC))
printf (Company: %s Ticket id: %s Date: %s, $row[company_name], 
$row[ticket_id], $row[date]);

mysql_free_result($result);
?  

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