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 t
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
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
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 ---
>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 `my.cn
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 doccum
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.
SELE
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 ab
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 2
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, t2
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 * FROM
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 * FROM
"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.)
> Ma
Hello,
On 05/20/2002 04:05 PM, Toby z wrote:
> 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 exi
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
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
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: " . $website['originalDomain'] . " and
find information";
echo $text;
}
I'll shut up now... :)
-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: $website['originalDomain'] and find
>information";
> }
The above code doesn't eve
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
foreach($website = mysql_fetch_array($result))
{
$text = "You can go here: and find
information";
eval($text);
}
You get the idea...
'Luck
-Szii
- Original Message -
From: "Bogdan ROMAN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 5:16 AM
Subject: [PHP-
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 ...
>
> releva
Try this:
$data = "13_45";
if (stristr($data,"_"))
{
list($a,$b)=split("_",$data);
echo $a;
echo "";
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
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 "First Name : ";
echo " Surname : ";
echo "";
echo
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
> charac
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
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'v
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. Bu
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:
");
print ("
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
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 meet
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
u
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 que
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
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 =
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");
w
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");
w
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: and find information
That needs to be output in a html webpage between two tags.
How can you eval the to the contents of
$website['originalDomain'] ?
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-4.
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
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
th
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] stripSlashe
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
('$full
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
002901c1feed$5695b2c0$94c405c8@gateway">news:00290
43 matches
Mail list logo