experchange > php

super70s (11-06-18, 11:39 PM)
Hi, I have an article directory site that runs on php. I have added 1800
articles to it over the past few years as I have time. Lately I've
noticed in the Admin Panel of the site (not the Cpanel of the server)
that it will not accept modifications to existing articles. Also
sometimes the browser will crash when I try that. Could these problems
be due to the db becoming too huge? The Admin Panel is accepting new
articles as normal though and they are displaying on the site.

In my server cPanel under "MySQL Databases," it did not say anything was
wrong with the db and when I checked it, I got this result:

[articlesite_artic.article_master] OK
[articlesite_artic.category_master] OK
[articlesite_artic.document_master] OK
[articlesite_artic.settings] OK
[articlesite_artic.user_master] OK

But I went ahead and did a "repair" on it anyway, and the message was
"db repaired."

When I tried to modify an existing article, the problem remained.

Any thoughts?
Lew Pitcher (11-07-18, 12:40 AM)
super70s wrote:

[..]
> "db repaired."
> When I tried to modify an existing article, the problem remained.
> Any thoughts?


Check the MySQL user privileges; does it include UPDATE privileges on the
relevant databases?
Luuk (11-07-18, 03:46 PM)
On 6-11-2018 22:39, super70s wrote:
[..]
> "db repaired."
> When I tried to modify an existing article, the problem remained.
> Any thoughts?


Are you using the correct statement to update this table?

What is the exact error message that is given when you try to update an
article?
Percival John Hackworth (11-07-18, 06:44 PM)
On 06-Nov-2018, super70s wrote
(in article<super70s-64F973.15393306112018>):

[..]
> "db repaired."
> When I tried to modify an existing article, the problem remained.
> Any thoughts?


Can you connect to the database with mysql? Can you update or remove records
from tables? Can you export the database to a SQL file?

These are primitives that point to issues with the database. The web
interface may be the underlaying problem. Until you isolate where the problem
is, it's anyone's guess. It's like going to the dealership and saying "the
car makes this weird sound when I go over 50".

Spend some more time isolating the issue and report back your findings.
super70s (11-08-18, 01:48 PM)
In article <5be2ecc4$0$32263$e4fe514c>,
Luuk <luuk> wrote:

> Are you using the correct statement to update this table?
> What is the exact error message that is given when you try to update an
> article?


The message in the "New Article" window says "Article Information Saved"
as normal, however it refuses to accept the modification.

I'm afraid I don't have a lot of experience with this, in fact I had to
hire someone to install the db so I apologize if I "offended anyone's
senses."

It isn't that big a deal really, I'm pretty good at proofreading the
articles before I post them but sometimes I'll spot a small typo or
something and want to go back and correct it (until now, lol).
Jerry Stuckle (11-08-18, 04:30 PM)
On 11/8/2018 6:48 AM, super70s wrote:
[..]
> It isn't that big a deal really, I'm pretty good at proofreading the
> articles before I post them but sometimes I'll spot a small typo or
> something and want to go back and correct it (until now, lol).


It sounds like you aren't checking the result codes from your SQL
statements, so your script does not tell you when a request failed.

You should check the result of *every* database request - or you'll run
into problems like this. Fix your code and see what the failure is.
Martin Gregorie (11-08-18, 05:56 PM)
On Thu, 08 Nov 2018 09:30:42 -0500, Jerry Stuckle wrote:

> On 11/8/2018 6:48 AM, super70s wrote:
> It sounds like you aren't checking the result codes from your SQL
> statements, so your script does not tell you when a request failed.
> You should check the result of *every* database request - or you'll run
> into problems like this. Fix your code and see what the failure is.


....and don't forget that some SQL statements generate a linked chain of
exception messages if they fail. Trapping the first exception may tell
your code that there is a problem and what sort it is, but if its fatal
you probably need to see all the exceptions in the chain to understand
what went wrong.
Luuk (11-08-18, 08:01 PM)
On 8-11-2018 12:48, super70s wrote:
[..]
> Luuk <luuk> wrote:
> The message in the "New Article" window says "Article Information Saved"
> as normal, however it refuses to accept the modification.


OK, your application is telling you "the information is saved", but you
do not see the info in your database.

> I'm afraid I don't have a lot of experience with this, in fact I had to
> hire someone to install the db so I apologize if I "offended anyone's
> senses."


You indicate not to have experience with this db.

How should we know what went wrong if we only see the descriptions of
wat want wrong, and do not see any logging, or any SQL statements?
(or, for the PHP part, any PHP-code)
The Natural Philosopher (11-08-18, 08:38 PM)
On 08/11/2018 18:01, Luuk wrote:
> On 8-11-2018 12:48, super70s wrote:
> OK, your application is telling you "the information is saved", but you
> do not see the info in your database.
> You indicate not to have experience with this db.
> How should we know what went wrong if we only see the descriptions of
> wat want wrong, and do not see any logging, or any SQL statements?
> (or, for the PHP part, any PHP-code)


I think that is the point...

he doesnt have access to admin level or indeed the code.

My guess is the user the code runs has no update privs. But does have
create,
super70s (11-09-18, 08:44 AM)
In article <ps1mag$n8m$1>,
Martin Gregorie <martin> wrote:

> On Thu, 08 Nov 2018 09:30:42 -0500, Jerry Stuckle wrote:
> ...and don't forget that some SQL statements generate a linked chain of
> exception messages if they fail. Trapping the first exception may tell
> your code that there is a problem and what sort it is, but if its fatal
> you probably need to see all the exceptions in the chain to understand
> what went wrong.


I guess a workaround could be to simply delete the article that needs
the modification, make the correction, then repost it as a new article.
But I'd lose any "link juice" that URL had.
Jerry Stuckle (11-10-18, 05:11 AM)
On 11/9/2018 1:44 AM, super70s wrote:
> In article <ps1mag$n8m>,
> Martin Gregorie <martin> wrote:
> I guess a workaround could be to simply delete the article that needs
> the modification, make the correction, then repost it as a new article.
> But I'd lose any "link juice" that URL had.


No, the "workaround" is to correct your code.
The Natural Philosopher (11-10-18, 10:30 AM)
On 10/11/2018 03:11, Jerry Stuckle wrote:
> No, the "workaround" is to correct your code.


Its not his code.

Wanker.
Jerry Stuckle (11-10-18, 03:34 PM)
On 11/10/2018 3:30 AM, The Natural Philosopher wrote:
> On 10/11/2018 03:11, Jerry Stuckle wrote:
>> No, the "workaround" is to correct your code.

> Its not his code.
> Wanker.


He may not have written it - but it's still his code. Idiot.
Jerry Stuckle (11-10-18, 03:36 PM)
On 11/8/2018 1:38 PM, The Natural Philosopher wrote:
> On 08/11/2018 18:01, Luuk wrote:
> I think that is the point...
> he doesnt have access to admin level or indeed the code.
> My guess is the user the code runs has no update privs. But does have
> create,


Only an idiot would specify admin privileges like that. But you would.
Martin Gregorie (11-10-18, 08:09 PM)
On Sat, 10 Nov 2018 08:34:37 -0500, Jerry Stuckle wrote:

> On 11/10/2018 3:30 AM, The Natural Philosopher wrote:
>> On 10/11/2018 03:11, Jerry Stuckle wrote:
>>> No, the "workaround" is to correct your code.

>> Its not his code.
>> Wanker.

> He may not have written it - but it's still his code. Idiot.


Tush Tush Tush.

I'm inclined to agree with Jerry here: the OP's answers look more like
something a user would say as opposed to even an inexperienced sysadmin
or developer.

So, to the OP: if I've guessed right, you should raise this with your
website's help desk if they provide you with access to a publishing
package that they installed and maintain or, if you've installed the
publishing package yourself, ask the package's authors for help or raise
a bug against it.

comp.lang.php is a discussion and self-help forum for developers capable
of writing and maintaining PHP code rather than those using PHP packages
that others maintain and/or modify. This explains why you're being given
answers suitable for a PHP programmer rather than the PHP package user
you would seem to be.

Similar Threads