Reply to Re: Can't submit data to db, but can read it.

Your name:

Reply:


Posted by IchBin on 08/03/06 18:09

ZeldorBlat wrote:
> bennett@snet.net wrote:
>> The code is available at the link I posted earlier as checkbook.php
>> http://eltonwilson.com/scripts/checkbook/
>>
>> Also it doesn't appear to be a problem with his script since it runs on
>> his site, but I'll try to ask him for info as well.
>>
>> Thanks
>>
>> Flamer wrote:
>>> bennett@snet.net wrote:
>>>
>>>> Hi list,
>>>>
>>>> I'm a noob to php. I'm trying to get a very simple checkbook script
>>>> working that is available here.
>>>>
>>>> http://eltonwilson.com/scripts/checkbook/
>>>>
>>>> I'm thinking I must have some type of server config issues, because
>>>> this works as a demo on the same site. I'm running SuSE 10 with php
>>>> 4.4, mysql 4.1 and apache 2.0.54.
>>>>
>>>> I can see whatever is in the db, but when I try to add/modify/delete
>>>> anything the page just seems to refresh without applying any of the
>>>> changes. On the demo, the pages change appropriately.
>>>>
>>>> I'm am able to run phpmyadmin and I can change the db as the checkbook
>>>> app would using the sql and these changes then appear in the checkbook
>>>> app itself.
>>>>
>>>> The page doesn't give any errors and I don't see any in the mysqld.log
>>>> file either. Is there something I could use to try an find out why the
>>>> writes aren't getting processed. I've screwed around with the
>>>> permissions (even 777) for everything in that directory and nothing
>>>> seems to change it other than the obvious lack of web server perms.
>>>>
>>>> Thanks,
>>>>
>>>> PB
>>> Why don't you ask the php developer that wrote the script? if you want
>>> help from me I need to see the code.
>>>
>>> Flamer.
>
> It runs on his site because his site has register_globals enabled and
> that particular script requires register_globals to be enabled (both
> are bad). Either enable it on your website or find a script that has
> been properly written.
>

I am New to PHP also. I noticed that you include 'db.php' but I do not
see where you are using the DB object? You may want to check out the
Docs: http://pear.php.net/package/DB

I think that it is recommended to use MDB2. I understand that DB is only
there for support for prior programs that use Pear's DB. I am sure
someone here can correct me.

Example 33-1. Fetching a result set

<?php
// Create a valid DB object named $db
// at the beginning of your program...
require_once 'DB.php';

$db =& DB::connect('pgsql://usr:pw@localhost/dbnam');
if (PEAR::isError($db)) {
die($db->getMessage());
}

// Proceed with getting some data...
$res =& $db->query('SELECT * FROM mytable');

// Get each row of data on each iteration until
// there are no more rows
while ($res->fetchInto($row)) {
// Assuming DB's default fetchmode is DB_FETCHMODE_ORDERED
echo $row[0] . "\n";
}

// Or, you could have done the same thing using fetchRow()
// while ($row =& $res->fetchRow()) {
// // Assuming DB's default fetchmode is DB_FETCHMODE_ORDERED
// echo $row[0] . "\n";
// }
?>

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация