RE: [PHP-DB] Can't see the results

2002-09-09 Thread Wilmar Perez


Hi guys, it's me again.

Well, I did as Peter suggested and changed my code for this:

$query_cat = select author.author_names || ' ' || author.author_surnames 
  as author_full_name from 
author, authorxcat
  where authorxcat.cat_code = 
$code
  and author.author_code = 
authorxcat.author_code;


$result_cat = mysql_query($query_cat) or die
($mysql_error());

$num_results_cat = mysql_num_rows($result_cat) or die
($mysql_error());

while($row = mysql_fetch_array($result_cat))
{
$content .= $row[author_full_name].br;
}


Well, it should give me the full name of 22 people but all I'm getting is a 
row of 22 zeros.  I checked the database and in fact the data is there.

Any idea of what I could be missing?

Thanks a lot for your help


***
 Wilmar Pérez
 Network Administrator
   Library System
  Tel: ++57(4)2105145
University of Antioquia
   Medellín - Colombia
  2002
***
 
 

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




RE: [PHP-DB] Can't see the results - It works now!!!

2002-09-09 Thread Wilmar Perez

Hello guys (again)

Well, just wanted to let you know that my code is working now, at the end it 
worked thanks to the help of Jim and Peter.  The following is the resulting 
code just in case anyone can make use of it.

Thankyou so much.

$query_cat = select concat(author.author_names,' ',author.author_surnames)
  as author_full_name from 
author, authorxcat
  where authorxcat.cat_code = 
$code
  and author.author_code = 
authorxcat.author_code;


$result_cat = mysql_query($query_cat) or die
($mysql_error());
$num_results_cat = mysql_num_rows($result_cat) or die
($mysql_error());

while($row = mysql_fetch_array($result_cat))
{
$content .= $row[author_full_name].br;
}


***
 Wilmar Pérez
 Network Administrator
   Library System
  Tel: ++57(4)2105145
University of Antioquia
   Medellín - Colombia
  2002
***
 
 

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




[PHP-DB] FW: Php database support

2002-09-09 Thread Walgamotte, David

  Hello All !!!
 
  We use PHP in a production e-commerce web environment with a mysql 
 database server. The higher ups have decided they want to move to 
 Microsoft SQL. I'm now tasked to convert our Unix Apache PHP 
 environment to use a remote Microsoft SQL server. I've researched and 
 used TDS the Sybase connector to Microsoft SQL. It works but is very 
 slow.
 
 Has anyone completed such a migration ? Can anyone recommend a solid 
 connector between UNIX PHP and Microsoft SQL DB and a place to go for 
 setup procedures ?
 
 Thanks You very much ?
 
 DW
 



[PHP-DB] POSTGRESQL PHP

2002-09-09 Thread Tomator

I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP script
working with pgsql base. I created database (typed createdb name) but when
trying execute script with pg_connect(host=localhost dbname=name); it
fails.

Any suggestions?



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




Re: [PHP-DB] POSTGRESQL PHP

2002-09-09 Thread Miles Thompson

1. run a script containing phpinfo() function and confirm you have support 
for pgsql
2. add code to display the error message generated by either php or pgsql 
when you try to connnect
3. (Maybe this should have been first) I don't know about Windows systems, 
but on *nix, PostgreSQL has to be started with the -i switch to be 
accessible from the Internet. Check docs.

Hope this helps - Miles Thompson

PS For help on the list #2 suggestion is really important.

At 06:10 PM 9/9/2002 +0200, Tomator wrote:
I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP script
working with pgsql base. I created database (typed createdb name) but when
trying execute script with pg_connect(host=localhost dbname=name); it
fails.

Any suggestions?



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

2002-09-09 Thread bbonkosk

Gosh..

It could be a bunch of things.  Maybe it requires a password, a username, is 
running on an alternate port, etc...
Any more information you can provide to us would be helpful.  Maybe echo out 
the output of pg_last_error()?

-Brad

 I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP script
 working with pgsql base. I created database (typed createdb name) but when
 trying execute script with pg_connect(host=localhost dbname=name); it
 fails.
 
 Any suggestions?
 
 
 
 -- 
 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] assist with SORT array

2002-09-09 Thread Terry Romine

I  have a head scratcher.. prob just a glitch on my side, but somehow I 
am confused with the results.

I have a php script pulling from a mysql database for id/names which is 
getting choices through a check box form. All of that works just fine, 
but I wanted to display the results sorted by title. My snippet of code 
is:

// $restaurants = array() of ids back from form
 for($i=0;$isizeof($restaurants);$i++) {
 $rest_id = $restaurants[$i];
 $sql=select name from restaurants where id=$rest_id;
 $result=mysql_query($sql) or die($sql . mysql_error());
 while($row=mysql_fetch_object($result)) {
 $rest_name .= ucwords(stripslashes($row-name)) . ;;
 }
 }
 $rest_array=explode(;,$rest_name);

 $rest_sort=sort($rest_array);  // -- the problem line

 die(checking: $rest_namebrbr size = 
.sizeof($rest_array) .  sorted:  . sizeof($rest_sort));

the results come back with 6 in the $rest_array but only 1 in the 
$rest_sort array! How is that??

checking: Hi-Ho Tavern;Village Inn;Speak Easy;Duane's House Of 
Pizza;Atomic Coffee;
size = 6 sorted: 1

What I am trying to accomplish is an array('Atomic Coffee', 'Duane's 
House Of Pizza','Hi-Ho Tavern','Speak Easy','Village Inn')

Help??

Terry Romine
Web Developer
JumpInteractive.com


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




[PHP-DB] Re: assist with SORT array

2002-09-09 Thread Bartosz Matosiuk

I'm sorry if I haven't undersood your post well, but my english is not very
good. Anyway what I understood is that you want to sort the result by the
name of restaurant. So mayby it would be a better idea not to sort the
result array, but sort the query:
SELECT name FROM restaurants WHERE id=$rest_id ORDER BY name;
Using that statement you will receive array with sorted restaurants names.

Terry Romine [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I  have a head scratcher.. prob just a glitch on my side, but somehow I
 am confused with the results.

 I have a php script pulling from a mysql database for id/names which is
 getting choices through a check box form. All of that works just fine,
 but I wanted to display the results sorted by title. My snippet of code
 is:

 // $restaurants = array() of ids back from form
  for($i=0;$isizeof($restaurants);$i++) {
  $rest_id = $restaurants[$i];
  $sql=select name from restaurants where id=$rest_id;
  $result=mysql_query($sql) or die($sql . mysql_error());
  while($row=mysql_fetch_object($result)) {
  $rest_name .= ucwords(stripslashes($row-name)) . ;;
  }
  }
  $rest_array=explode(;,$rest_name);

  $rest_sort=sort($rest_array); // -- the problem line

  die(checking: $rest_namebrbr size =
 .sizeof($rest_array) .  sorted:  . sizeof($rest_sort));

 the results come back with 6 in the $rest_array but only 1 in the
 $rest_sort array! How is that??

 checking: Hi-Ho Tavern;Village Inn;Speak Easy;Duane's House Of
 Pizza;Atomic Coffee;
 size = 6 sorted: 1

 What I am trying to accomplish is an array('Atomic Coffee', 'Duane's
 House Of Pizza','Hi-Ho Tavern','Speak Easy','Village Inn')

 Help??

 Terry Romine
 Web Developer
 JumpInteractive.com




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




Re: [PHP-DB] POSTGRESQL PHP

2002-09-09 Thread Tomator

Miles Thompson wrote:
 1. run a script containing phpinfo() function and confirm you have support
 for pgsql
 2. add code to display the error message generated by either php or pgsql
 when you try to connnect
 3. (Maybe this should have been first) I don't know about Windows systems,
 but on *nix, PostgreSQL has to be started with the -i switch to be
 accessible from the Internet. Check docs.

 Hope this helps - Miles Thompson

Yes, it does :)
First, I had to remove one little semicolon in php.ini (extensions) and
configure extensions.patch. After restart of Apache PHP began to display
some errors that finally guided me to succesfull pg_connect.

Thanks!



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




[PHP-DB] php - checkboxes - mysql

2002-09-09 Thread Chris

Greetings,

I am just starting with php and need some help/code example for
setting checkbox values from mysql. My setup is the following:

The mysql database holds data and checkbox values in respective columes.
For example

nameaddress phone   homeno  workno  pagerno
Chris   555-12121   0   0

1 = checkbox should be checked
0 = checkbox should not be checked

On the webpage side I would have name, address and phone number textboxes,
and then 3 checkboxes for the homeno, workno and pagerno.

When the page loads I would like to have the checkboxes be automatically
checked or left uncheck based on the mysql query to the db. I do not want
to do any grouping or anything, just query mysql for the homeno value, set
it, then check the workno value, set it, etc..

Any help is GREATLY appreciated.
Chris



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




[PHP-DB] whats wrong with my sql insert statement?

2002-09-09 Thread user

Hi
I am using redhat 7.3 with mysql-3.23.49-3 php-4.1.2-7.3.4 
apache-1.3.23-11.
I want to insert few values into a mysql table. This input.php sort 
works. it will add a new entray to the table but with blank values. What 
did I do wrong?
#
#
# file name input.php
?php

$db_name =cheese_catalog;
$table_name = user;
$connection = mysql_connect(localhost,test,test) or die(Couldn't 
Connect.);
$db = mysql_select_db($db_name, $connection) or die(Couldn't select 
database.);
if (none_required==none_required) {

$sql = INSERT INTO $table_name (first_name,location,phone,messages) 
VALUES (\$first_name\,\$location\,\$phone\, \$messages\);;
$result = mysql_query($sql, $connection) or die(Error #. 
mysql_errno() . :  . mysql_error());

include(input_added.html);

}

?
#

# file name input.html
#
html
head
titleNew Record/title
/head
body
pPlease fill out the following information:/p
form method=post action=input.php enctype=multipart/form-data
table width=100% border=0 cellspacing=3 cellpadding=3
  tr
   td width=25%first_name:/td
   td width=75%input name=first_name type=text size=40 
maxlength=255 value=/td
  /tr
  tr
   td width=25%location:/td
   td width=75%input name=location type=text size=40 
maxlength=255 value=/td
  /tr
  tr
   td width=25%phone:/td
   td width=75%input name=phone type=text size=40 
maxlength=255 value=/td
  /tr
  tr
  td width=25%messages:/td
   td width=75%input name=messages type=text size=40 
maxlength=255 value=/td
  /tr
  tr
   td width=25%nbsp;/td
   td width=75% align=leftinput type=submit 
name=submit value=Enternbspinput type=reset name=reset/td
  /tr
/table
/form
/body
/html
#
#




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




Re: [PHP-DB] POSTGRESQL PHP

2002-09-09 Thread TuxMonkey

You might also want to specify a user to connect as, otherwise the system
will assume you are trying to connect as the user you are logged in as.
Would defainately help a bit to know exactly what error your getting.

- Edwin

- Original Message -
From: Miles Thompson [EMAIL PROTECTED]
To: Tomator [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, September 09, 2002 11:52 AM
Subject: Re: [PHP-DB] POSTGRESQL  PHP


 1. run a script containing phpinfo() function and confirm you have support
 for pgsql
 2. add code to display the error message generated by either php or pgsql
 when you try to connnect
 3. (Maybe this should have been first) I don't know about Windows systems,
 but on *nix, PostgreSQL has to be started with the -i switch to be
 accessible from the Internet. Check docs.

 Hope this helps - Miles Thompson

 PS For help on the list #2 suggestion is really important.

 At 06:10 PM 9/9/2002 +0200, Tomator wrote:
 I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP
script
 working with pgsql base. I created database (typed createdb name) but
when
 trying execute script with pg_connect(host=localhost dbname=name); it
 fails.
 
 Any suggestions?
 
 
 
 --
 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] whats wrong with my sql insert statement?

2002-09-09 Thread Michael Hazelden

Hi there,

Two things:

(a) in my experience - you should use single quotes in your query to
surround the values and so you don't need to escape them either (e.g.
'$first_name')

and (b) Make sure register_globals is on - otherwise you need to use
$_POST[first_name]

Cheers,

Michael.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 10 September 2002 01:15
To: [EMAIL PROTECTED]
Subject: [PHP-DB] whats wrong with my sql insert statement?


Hi
I am using redhat 7.3 with mysql-3.23.49-3 php-4.1.2-7.3.4 
apache-1.3.23-11.
I want to insert few values into a mysql table. This input.php sort 
works. it will add a new entray to the table but with blank values. What 
did I do wrong?
#
#
# file name input.php
?php

$db_name =cheese_catalog;
$table_name = user;
$connection = @mysql_connect(localhost,test,test) or die(Couldn't 
Connect.);
$db = @mysql_select_db($db_name, $connection) or die(Couldn't select 
database.);
if (none_required==none_required) {

$sql = INSERT INTO $table_name (first_name,location,phone,messages) 
VALUES (\$first_name\,\$location\,\$phone\, \$messages\);;
$result = @mysql_query($sql, $connection) or die(Error #. 
mysql_errno() . :  . mysql_error());

include(input_added.html);

}

?
#

# file name input.html
#
html
head
titleNew Record/title
/head
body
pPlease fill out the following information:/p
form method=post action=input.php enctype=multipart/form-data
table width=100% border=0 cellspacing=3 cellpadding=3
  tr
   td width=25%first_name:/td
   td width=75%input name=first_name type=text size=40 
maxlength=255 value=/td
  /tr
  tr
   td width=25%location:/td
   td width=75%input name=location type=text size=40 
maxlength=255 value=/td
  /tr
  tr
   td width=25%phone:/td
   td width=75%input name=phone type=text size=40 
maxlength=255 value=/td
  /tr
  tr
  td width=25%messages:/td
   td width=75%input name=messages type=text size=40 
maxlength=255 value=/td
  /tr
  tr
   td width=25%nbsp;/td
   td width=75% align=leftinput type=submit 
name=submit value=Enternbspinput type=reset name=reset/td
  /tr
/table
/form
/body
/html
#
#




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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




Re: [PHP-DB] whats wrong with my sql insert statement?

2002-09-09 Thread user

Thanks for your suggestions.
first my /etc/php.ini
register_globals = on
second i made the change as you suggested and i added a
[$blabla = truly random;]
when the input.php is excuated, 'blabla' value is inserted into the 
table. '$first_name' is still left blank.
this leads me to believe that '$first_name' is blank to start with! 
somehow the input.html gives input.php blank $first_name , $location .
care to look at my input.html ? thanks alot.

#
?php

$db_name =cheese_catalog;
$table_name = user;
$blabla =  bla bla;
$connection = @mysql_connect(localhost,test,new0pass) or 
die(Couldn't Connect.);
$db = @mysql_select_db($db_name, $connection) or die(Couldn't select 
database.);
if (none_required==none_required) {

$sql = INSERT INTO $table_name (first_name,location,phone,messages) 
VALUES ('$first_name','$location','$phone', '$blabla');;
$result = @mysql_query($sql, $connection) or die(Error #. 
mysql_errno() . :  . mysql_error());

include(input_added.html);

}

?
#


Michael Hazelden wrote:
 Hi there,
 
 Two things:
 
 (a) in my experience - you should use single quotes in your query to
 surround the values and so you don't need to escape them either (e.g.
 '$first_name')
 
 and (b) Make sure register_globals is on - otherwise you need to use
 $_POST[first_name]
 
 Cheers,
 
 Michael.
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 10 September 2002 01:15
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] whats wrong with my sql insert statement?
 
 
 Hi
 I am using redhat 7.3 with mysql-3.23.49-3 php-4.1.2-7.3.4 
 apache-1.3.23-11.
 I want to insert few values into a mysql table. This input.php sort 
 works. it will add a new entray to the table but with blank values. What 
 did I do wrong?
 #
 #
 # file name input.php
 ?php
 
 $db_name =cheese_catalog;
 $table_name = user;
 $connection = @mysql_connect(localhost,test,test) or die(Couldn't 
 Connect.);
 $db = @mysql_select_db($db_name, $connection) or die(Couldn't select 
 database.);
 if (none_required==none_required) {
 
 $sql = INSERT INTO $table_name (first_name,location,phone,messages) 
 VALUES (\$first_name\,\$location\,\$phone\, \$messages\);;
 $result = @mysql_query($sql, $connection) or die(Error #. 
 mysql_errno() . :  . mysql_error());
 
 include(input_added.html);
 
 }
 
 ?
 #
 
 # file name input.html
 #
 html
 head
 titleNew Record/title
 /head
 body
 pPlease fill out the following information:/p
 form method=post action=input.php enctype=multipart/form-data
 table width=100% border=0 cellspacing=3 cellpadding=3
   tr
td width=25%first_name:/td
td width=75%input name=first_name type=text size=40 
 maxlength=255 value=/td
   /tr
   tr
td width=25%location:/td
td width=75%input name=location type=text size=40 
 maxlength=255 value=/td
   /tr
   tr
td width=25%phone:/td
td width=75%input name=phone type=text size=40 
 maxlength=255 value=/td
   /tr
   tr
   td width=25%messages:/td
td width=75%input name=messages type=text size=40 
 maxlength=255 value=/td
   /tr
   tr
td width=25%nbsp;/td
td width=75% align=leftinput type=submit 
 name=submit value=Enternbspinput type=reset name=reset/td
   /tr
 /table
 /form
 /body
 /html
 #
 #
 
 
 
 



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




Re: [PHP-DB] Enhancement of script

2002-09-09 Thread leo g. divinagracia iii

start with the easy part.  to display 3 months at a time, just do a 3 
cell table where each cell contains a month.  assuming you can write 
code to do one month, how is 2, 3 or even more months that difficult?

as for doing multiple days, either draw a month with check boxes on 
them.  or have a pull down tool that can you do mutiple selections.

Ray Healy (Data Net Services) wrote:
 Dear All
 
 I have recently downloaded a calendar from CST (which is no longer
 supported ) and I have made a few changes to the script.
 
 The calendar will be used to see when something is booked and you can assign
 messages to it as well which the general user cannot see. In this respects I
 have created 2 pages - welcome .php for the general viewer and admin_welcome
 for the updating of the calendar.
 
 What I would like to do is to be able to enter multiple dates in at the same
 time - either saying from a start date for so many days or from a start date
 to an end date.
 
 After spending hours looking at the code and in this forum I cannot seem to
 get it right - basically I cannot do it.
 
 I was wondering if someone could have a look and tell me where I am going
 wrong.
 
 I have attached the files to this email along with the mySQL table file in
 case another column needs to be added.
 
 You can see the script running at
 www.matrix-hosting.co.uk/prestige/welcome.php for the general view and
 www.matrix-hosting.co.uk/prestige/admin_welcome.php for the admin side.
 
 Any help would be appreciated
 
 
 Ray
 
 P.S. if any one also knows how to get it to display a 2 or 3 months at a
 time or even a year this would also be a bonus as I have tried to do this as
 well.
 
 



-- 
Leo G. Divinagracia III
[EMAIL PROTECTED]


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