[PHP-DB] Re: First Script

2002-05-20 Thread Coert Metz
I don't know how mysql_fetch_array() works. I think you have to handle this by yourself by putting something in the loop. You can also make a query for it (SELECT sum(*) FROM time) Coert César l . aracena [EMAIL PROTECTED] schreef in bericht

[PHP-DB] stripSlashes function

2002-05-20 Thread Lisi
I have a form that allows a person to enter an announcement into a database using a form. The form and the query work fine. $query = INSERT INTO maztov (fullname1, fullname2, city1, city2, email1, email2, post_fullname, mazal_text, post_city, post_email, other_emails, entered) VALUES

RE: [PHP-DB] stripSlashes function

2002-05-20 Thread SP
You need to add slashes when putting data into your database. When you want to display the data from your database, that's when you strip the slashes. -Original Message- From: Lisi [mailto:[EMAIL PROTECTED]] Sent: May 20, 2002 5:33 AM To: [EMAIL PROTECTED] Subject: [PHP-DB]

RE: [PHP-DB] stripSlashes function

2002-05-20 Thread Lisi
The slashes are being added by the MagicQuotes feature in PHP (I think) when the form is submitted, and the slashes are being put into the database but I don't want them there. When I echo the query it does have the slashes, and when I echo it after applying stripslashes they are gone, but

RE: [PHP-DB] stripSlashes function

2002-05-20 Thread SP
What I am saying is that you have to store the slashes in your database. If you did not have the slashes then your database insert would be screwed up. For example this would work fine if the variable $fullname was Michael Dell but it would not work if you had Michael O'Dell. Why not? Look

[PHP-DB] Re: Postgres-Php-Transaction

2002-05-20 Thread Yasuo Ohgaki
Does this happen with latest PHP? If yes, please report this as a bug. PS: Current PostgreSQL module is trying to rollback uncommitted transactions when request is finished. This is old postgresql module issue, probably. -- Yasuo Ohgaki Max Buvry wrote: Hi, I use Postgresql 7.0 +

[PHP-DB] DB and eval. HELP !!!

2002-05-20 Thread Bogdan ROMAN
Hello I busted my a$$ out to figure it out but i had to ask for help. Considering you have this line in a DB (TEXT field): You can go here: strong?=$website['originalDomain']?/strong and find information That needs to be output in a html webpage between two p tags. How can you eval the

[PHP-DB] returning all rows

2002-05-20 Thread Todd Williamsen
I know I have asked this silly question before, but forgive me since I have been a bit rusty with PHP lately So how do I return all rows? I have this: $sql= SELECT id, city, date FROM meetings WHERE city = \$city\ ; $result = mysql_query($sql,$connection) or die(Couldn't execute query); while

[PHP-DB] Returning all rows

2002-05-20 Thread Todd Williamsen
I know I have asked this silly question before, but forgive me since I have been a bit rusty with PHP lately So how do I return all rows? I have this: $sql= SELECT id, city, date FROM meetings WHERE city = \$city\ ; $result = mysql_query($sql,$connection) or die(Couldn't execute query); while

Re: [PHP-DB] returning all rows

2002-05-20 Thread Bogdan Stancescu
Just lose the WHERE city=\$city\ in the SQL. Bogdan Todd Williamsen wrote: I know I have asked this silly question before, but forgive me since I have been a bit rusty with PHP lately So how do I return all rows? I have this: $sql= SELECT id, city, date FROM meetings WHERE city = \$city\ ;

[PHP-DB] Re: Returning all rows

2002-05-20 Thread Todd Williamsen
It needs that line to sort them by city. But it only returns one row Todd Williamsen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I know I have asked this silly question before, but forgive me since I have been a bit rusty with PHP lately So how do I return

Re: [PHP-DB] returning all rows

2002-05-20 Thread Todd Williamsen
It needs that line to sort them by city. But it only returns one row Bogdan Stancescu [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Just lose the WHERE city=\$city\ in the SQL. Bogdan Todd Williamsen wrote: I know I have asked this silly question before,

Re: [PHP-DB] Re: Question about ODBC databases

2002-05-20 Thread Gerardo Morales
Gracias Juan. Sobre el mismo tema, aunque a la vez separado, en el caso de que la BD se pusiera en forma local, en que directorio se especifica? es necesario hacer algun cambio en php.ini para especificarle una localidad en especifico?? en el caso de que asi sea, alguien sabra si es posible

Re: [PHP-DB] Returning all rows

2002-05-20 Thread Maureen
Put the echo inside the while statement. HTH Todd Williamsen [EMAIL PROTECTED] said: I know I have asked this silly question before, but forgive me since I have been a bit rusty with PHP lately So how do I return all rows? I have this: $sql= SELECT id, city, date FROM meetings WHERE

Re: [PHP-DB] Returning all rows

2002-05-20 Thread Camelia Enderby
Echo your data in the loop. like this: $sql= SELECT id, city, date FROM meetings WHERE city = \$city\ ; $result = mysql_query($sql,$connection) or die(Couldn't execute query); while ($row = mysql_fetch_array($result)) { $id = $row[id]; $city = $row[city]; $date = $row[date]; echo $date; }

[PHP-DB] problems 'adding' to MySQL DBs

2002-05-20 Thread cin
using Apache 1.3.20 and MySQL 3.23-49a, i can connect to the database using mysql_connect no problem, but for some reason, when i try to add to the database, there is blank output. when i check the database, it only registers blanks ... relevant code as follows: submitform.php: html body ?

Re: [PHP-DB] returning all rows

2002-05-20 Thread Bogdan Stancescu
Well, then maybe you only have one row with that city in the database? If you want to order, but return all rows, use ORDER BY. Plus, you don't output anything in the while loop - how do you know there's only one row? Bogdan Todd Williamsen wrote: It needs that line to sort them by city.

[PHP-DB] Character check in string

2002-05-20 Thread Prodoc
Is there a php function to check if a string contains a certain kind of character and is there a function to split up a string? e.g. $data = 13_45 I want to check if variable $data contains the character _. If that's the case I want to split the variable (array or seperate variables) so I've

RE: [PHP-DB] Character check in string

2002-05-20 Thread Leotta, Natalie (NCI/IMS)
This should get you started. http://www.php.net/manual/en/function.split.php There are other ones too, like explode. -Natalie -Original Message- From: Prodoc [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 1:00 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Character check in string

Re: [PHP-DB] Character check in string

2002-05-20 Thread Martin Cabrera Diaubalick
Check strstr explode functions HTH Regards - Original Message - From: Prodoc [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 20, 2002 6:59 PM Subject: [PHP-DB] Character check in string Is there a php function to check if a string contains a certain kind of character and

[PHP-DB] unable to insert row with php+pgsql

2002-05-20 Thread ktt
hello, I have a strange problem - unable to insert data in to postgresql table, the script inserts only empty rows. (if i change variables $firstname and $surname to strings, the script works.) Maybe the problem in configuration of PHP? ? echo form action=\pgsqltest01.php\ method=\get\; echo

Re: [PHP-DB] Character check in string

2002-05-20 Thread Camelia Enderby
Try this: $data = 13_45; if (stristr($data,_)) { list($a,$b)=split(_,$data); echo $a; echo br; echo $b; } Cami - Original Message - From: Prodoc [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 20, 2002 5:59 PM Subject: [PHP-DB] Character check in string Is there a php

Re: [PHP-DB] problems 'adding' to MySQL DBs

2002-05-20 Thread Jason Wong
On Monday 20 May 2002 23:31, cin wrote: using Apache 1.3.20 and MySQL 3.23-49a, i can connect to the database using mysql_connect no problem, but for some reason, when i try to add to the database, there is blank output. when i check the database, it only registers blanks ... relevant

Re: [PHP-DB] DB and eval. HELP !!!

2002-05-20 Thread szii
foreach($website = mysql_fetch_array($result)) { $text = You can go here: strong?=$website['originalDomain']?/strong and find information; eval($text); } You get the idea... 'Luck -Szii - Original Message - From: Bogdan ROMAN [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday,

Re: [PHP-DB] problems 'adding' to MySQL DBs

2002-05-20 Thread szii
Here's a hint...ALWAYS use proxies for your query strings. $query = insert into firsttab (first_name, last_name) values ('$first_name', '$last_name'); mysql_query($query); var_dump($query); // copy output and paste into the mysql // command line

Re: [PHP-DB] DB and eval. HELP !!!

2002-05-20 Thread szii
Oops, minor oversights on my part. If you're calling eval() in the context of a PHP script, you don't have to ?= ? the eval'd code... foreach($website = mysql_fetch_array($result)) { $text = You can go here: strong$website['originalDomain']/strong and find information; } The above code

Re: [PHP-DB] DB and eval. HELP !!!

2002-05-20 Thread szii
I'm sorry, I'm having an off day. This'll be my last post on the subject. *sigh* Apologies up front... while($website = mysql_fetch_array($result)) { $text = You can go here: strong . $website['originalDomain'] . /strong and find information; echo $text; } I'll shut up now... :)

[PHP-DB] Adding totals

2002-05-20 Thread César L . Aracena
Hi all, Is there a way for me in PHP4 to add all the contens (floating numbers) of a cartain column whithin a row and show up the result? I have several time inputs and need to show the total. Thanx. Cesar Aracena [EMAIL PROTECTED] Neuquen, Argentina

[PHP-DB] Re: unable to insert row with php+pgsql

2002-05-20 Thread Stellan Klebom
Ktt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hello, I have a strange problem - unable to insert data in to postgresql table, the script inserts only empty rows. (if i change variables $firstname and $surname to strings, the script works.) Maybe the

[PHP-DB] xml doccument validation ?????

2002-05-20 Thread toby z
guyz its terrable i have a well formed xml doccument but i cant get it validated ... i keep getting this error this file is not valid. all fields referred to from the key identity constraint 'user_info_memb_id' must exist now i had made 6 tables in access but i made a

[PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread admin
Okay, now this is my first try on fetching data from two tables, and frankly I'm starting to pull my hair out ;) All I want is to fetch some data from two seperate tables in my database. So far I have tried different approches, and below is what I think should work, but doesn't :( SELECT *

[PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread admin
Okay, now this is my first try on fetching data from two tables, and frankly I'm starting to pull my hair out ;) All I want is to fetch some data from two seperate tables in my database. So far I have tried different approches, and below is what I think should work, but doesn't :( SELECT *

Re: [PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread Bogdan Stancescu
Well, the first question is what's the expected output? If you're trying to get, say, title from table1 and rating from table2 and identify the books in table1 by the unique field id and in table2 by the field book_id, then this is what you should have to end up with: SELECT t1.title,

[PHP-DB] replication questions

2002-05-20 Thread Jeff Field
I think I understand how to set up replication but have a couple unanswered questions. I'm hoping the list can help. I have two servers with MySQL. Each server currently has completely different databases, except for the standard mysql permissions database. Server 1 is in production and server

RE: [PHP-DB] Re: ADODB - whaddya think?

2002-05-20 Thread Jerome Houston
Benjamin- first of all, the ADODB that ruprecht is talking about is different than the one i'm talking about. go to http://php.weblogs.com/ADODB for the one i'm talking about. the one i'm talking about does have support for the one he's talking about built in, though. the one i'm talking

Re: [PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread szii
If you're looking to do cross-table joins, I'd advise a good book/class on basic SQL or you're going to get in over your head very very quickly. SELECT * FROM table1,table2; This WILL run, but there's no where clause. Therefore it will return all of table1 matched against all of table 2.

[PHP-DB] xml doc validation .... details ...... ! ! ! !

2002-05-20 Thread toby z
well its something like i need to take user input and store it somewhere and then retrieve it back thru DOM and i guess i need to store that input in an xml doccument like the one i sent earlier or do i now the thing that im most concerned bout is . this

Re: [PHP-DB] replication questions

2002-05-20 Thread szii
From the mySQL Replication docs... snip -- In Version 3.23.15, all of the tables and databases will be replicated. Starting in Version 3.23.16, you can restrict replication to a set of databases with replicate-do-db directives in

Re: [PHP-DB] xml doc validation .... details ...... ! ! ! !

2002-05-20 Thread szii
Your questions are far too vague and XML/XML:Schema/XSLT etc are far too complicated to explain without definitive focus'd questions. XML allows you to do whatever YOU want in whatever format YOU want. Best help I can give is this... http://www.w3.org/ 'Luck -Szii - Original Message

RE: [PHP-DB] replication questions

2002-05-20 Thread Ray Hunter
Answer to your questions: 1. Yes they can have dbs that each other does not know about. 2. Follow the instructions on setting up replication in mysql docs. They are easy to set up... Regarding the development db's...they are development and they should be on only one server. Why would you want

[PHP-DB] Adding totals

2002-05-20 Thread César L . Aracena
Hi all, Is there a way for me in PHP4 to add all the contens (floating numbers) of a cartain column whithin a row and show up the result? I have several time inputs and need to show the total. Thanx. Cesar Aracena [EMAIL PROTECTED] Neuquen, Argentina

[PHP-DB] Re: Adding totals

2002-05-20 Thread Adam Royle
This should be it (if I am understanding you correctly). Adam $strSQL = SELECT SUM(columnName) as sum FROM tblName; $result = mysql_query($strSQL); while ($row = mysql_fetch_array($result)){ $total = $row[sum]; } Hi all, Is there a way for me in PHP4 to