There is no need to use transactions if you are dealing with 1 table.
Have a version column in the table which is numeric. When you first
select/edit the record, store the version number.
When you update, use:
update table set version = version + 1, data = ... where key=$id and
version = $
Which database do you use ?
I donĀ“t know mySql ... but I know Sybase very well and there you have
something called Triggers ...
[Cite SybaseDoc]
A trigger is a stored procedure that goes into effect when you insert,
delete, or update data in a table
[/CITE]
You could say for example
Create trig
Hi there!
I am trying to use such combination of software: Apache
1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem - some
postgres database admin script (php) says "Unable to connect to server
using user=user, password=password, etc".
May be php script tries to autheticate the us
> Table was created with this
>
> CREATE TABLE `descriptions` (
> `id_property` bigint(20) NOT NULL default '0',
> `short_desc` varchar(255) default NULL,
> `long_desc` text,
> KEY `id_property`(`id_property`),
> PRIMARY KEY (`id_property`),
> UNIQUE KEY `id_property_2`(`id_property`)
Table was created with this
CREATE TABLE `descriptions` (
`id_property` bigint(20) NOT NULL default '0',
`short_desc` varchar(255) default NULL,
`long_desc` text,
KEY `id_property`(`id_property`),
PRIMARY KEY (`id_property`),
UNIQUE KEY `id_property_2`(`id_property`)
) TYPE=MyISAM COM
Hi!
Don't use the ID to count prev or next image. Use the $offset variable
instead.
$result=mysql_query("select id,name,phone ".
"from TABLE where YOUR CONDITIONAL HERE ".
"order by ID asc limit $offset,$limit");
Regards
--
Shin
"Jeff Oien" <[EMAIL PROTECTED]> wrote in message
[EMAIL
i have never tried this myself, but i think you might have to load the
postgres module in php separately
there is a line like
;extension=php_pgsql.dll
or something in you php.ini file, remove the ; (comment) to enable it, and
restart apache
HTH
beau
// -Original Message-
// From: Ja
on 8/30/01 4:06 PM, Malcolm White at [EMAIL PROTECTED] wrote:
> $query = "UPDATE Groups SET GName=$new_name WHERE GID=$gid";
If the Gname field is a string type, there should probably be quotes around
it.
$query = 'UPDATE Groups SET GName="' . $new_name . '" WHERE GID=' . $gid;
HTH.
S
I'm having a hard time figuring this out. I have a photo album that displays
one image at a time. I want to have Previous and Next links for images in
a users album. This was suggested:
http://www.phpbuilder.com/columns/rod2221.php3
but it seems to be more for a number of results instead of on
oo okay it's working right now !
thank you so much !
--- "Dave Watkinson" <[EMAIL PROTECTED]>
> wrote:
>OK, try this
>
>
>$db =3D mysql_connect("localhost", "","pass");
>
>mysql_select_db("mydatabase_com",$db);
>$result =3D mysql_query("SELECT * FROM big_member WHERE position=3D'Squads'
>ORDE
DW was correct, Nagasea. The way to do what you want to do is to use the
urlencode (and perhaps the urldecode) PHP command(s). They are in the PHP
manual. I don't understand what it was that DB told you to do, so I cannot
comment on that, but the correct solution to your problem lies with urlen
OK, try this
$db = mysql_connect("localhost", "","pass");
mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads'
ORDER by first LIMIT 0,300",$db);
while ($myrow = mysql_fetch_row($result)) {
$link_string = urlencode($myrow[3])
it's still not working :(
maybe u need my script to see
$db = mysql_connect("localhost", "","pass");
mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads' ORDER by first
LIMIT 0,300",$db);
while ($myrow = mysql_fetch_row($result)) {
it's still not working :(
maybe u need my script to see
$db = mysql_connect("localhost", "","pass");
mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads' ORDER by first
LIMIT 0,300",$db);
while ($myrow = mysql_fetch_row($result)) {
it's still not working :(
maybe u need my script to see
$db = mysql_connect("localhost", "","pass");
mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads' ORDER by first
LIMIT 0,300",$db);
while ($myrow = mysql_fetch_row($result)) {
I am having a problem with UPDATE queries with MySQL. Insert, Delete, etc
work fine. I have checked the query statement and it works fine directly
with MySQL just not in a PHP script. An example function is;
function update_gname($gid, $new_name){
$query = "UPDATE Groups SET GNa
Hi folks.
I am getting a bizarre error when trying to insert CLOB data into my
Oracle 9i database. (Using PHP4 on Apache 1.3.20) Error refers to a
missing 'comma'?! Here is the exact error:
Warning: OCIStmtExecute: ORA-00917: missing comma in
/www/htdocs/Etrack/oracle_operations.php on line 52
C
What about using a view?
(Not entirely sure if Oracle supports them, but I don't see why not)
Ryan
-Original Message-
From: Tom Wallace [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 29, 2001 5:13 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Tablename issue..
Tried this - same
Hello!!!
Use mysql_fetch_object...
$myrow->WHATEVER
Whatever = whatever the field name is
Dan
> --
> From: Nagasea
> Reply To: [EMAIL PROTECTED]
> Sent: Thursday, August 30, 2001 5:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Simple dat
try urlencode in the PHP manual ... I believe that'll do the trick!
Cheers
Dave
-Original Message-
From: Nagasea [mailto:[EMAIL PROTECTED]]
Sent: 30 August 2001 23:02
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Simple database error (SPACE)
//-- Anybody can help me with this problem (I t
//-- Anybody can help me with this problem (I think
//-- it's simple but im to stupid to know the answer)
==
while ($myrow = mysql_fetch_row($result)) {
echo("
$myrow[3] ."");
}
==
If I have a databas
Hi there!
I am trying to use such combination of software: Apache
1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem - some
postgres database admin script (php) says "Unable to connect to server".
I think i did everything i could - apache is running without problems, php
is configu
At 10:30 PM 8/30/2001 +, you wrote:
>Hi! This is the ezmlm program. I'm managing the
>[EMAIL PROTECTED] mailing list.
>
>I'm working for my owner, who can be reached
>at [EMAIL PROTECTED]
>
>Acknowledgment: I have added the address
>
>[EMAIL PROTECTED]
>
>to the php-db mailing list.
>
>Wel
I had a database like this
Name : John Doe
Sex : Male
when i want to call this data with url link
http://www.test.com/template.php?nick=John
why the (space)Doe is not in there.
what I suppose to do with the space
so it will looks like
http://www.test.com/template.php?nick=John%20Doe
_
HELP!
I'm trying to use a DBM database as a book i bought discribes. I have copied the
example but to no avail. The oly coclusion i ca come to is that i need somethig extra
installed, or need to use a specific include. At the moment when i try to use it i get
the following error;
"Fatal error
- Original Message -
From: "Scott Mebberson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 29, 2001 8:16 PM
Subject: [PHP-DB] Selection an id from a table where it doesn't exisit in
another
> Hi Guys,
>
> I have two tables, words and searchwords. words contains a li
Thanks for the help Christopher and boclair. I think my problem was
putting single quotes around the field name within the parenthesis:
select date_format('creation_date', '%b %D, %Y') from Chart_Users;
This works:
select date_format(creation_date, '%M %D, %Y') from Chart_Users;
or
select date_fo
I'd suggest only inserting data into the "working" table throughout the
day, then on a nightly basis drop the index on the archived table, import
the data from the working table into the archived one, re-create the
index and clear out your working table.
As time goes on that archived table is goi
Greetings,
I am setting up two seperate tables that will hold identically INSERTed
data. The reason for this is that one table will hold data that will expire
by timestamp daily and the other will hold the very same data for later
manipulation.
Is sending identical data like this to two seperate
> -Original Message-
> From: Andrew Chase [mailto:[EMAIL PROTECTED]]
> Or you could do it longhand -
>
> while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
> {
> print ("{$row["Reason"]}");
> print ("{$row["OtherField1]}");
> print ("{$row["OtherField2]}");
> }
>
Wh
Nothing comes to mind that isn't a bit of a "hack" really. You could try
seperating the data with delimiters before putting it in, then splitting
the data back up into an array at query time.
You could setup some tables, one called 'arrays' and one called
'array_values".
Arrays would pretty muc
I would like to know if it is somehow possible to store an array in a mysql
DB.
Could somebody please help me.
greetz Jeroen
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list adm
SELECT distinct(students.fname), courses.title AS course FROM students,
courses,
> course_enrolments, groups, locations, staff WHERE
> (students.studentID=course_enrolments.studentID AND
> course_enrolments.courseID=courses.courseID) AND
> (students.groupID=groups.groupID) AND (staff.staffID=cours
Thanks for your reply. Yeah that was the problem. I guess it is a good
practice to use track_vars in case that globals are not on.
Thanks again
-Original Message-
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: August 29, 2001 11:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: General P
34 matches
Mail list logo