Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Database Problem

Asked Modified Viewed 1,463 times
G
gilesytheking
G
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
asked
Junior Member

I have added 2 new databases tables for something i am working on, but for some reason the databases can not be found. I keep getting the error

Quote

Notice: Use of undefined constant DB_CLASSIFIED_CATS - assumed 'DB_CLASSIFIED_CATS' in /home/expat12/public_html/expatinformer.com/submit.php on line 126
Table 'expat12_expatinformer.DB_CLASSIFIED_CATS' doesn't exist


Can anyone help? im not sure where u have gone wrong
0 replies

9 posts

S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

Without having seeing your code you can try this:

Insert the following above your call to the database:

if (!defined("DB_CLASSIFIED_CATS")) {
   define("DB_CLASSIFIED_CATS", DB_PREFIX."classified_cats");
}

- the error you're getting is because the constant ain't defined..
0 replies
G
gilesytheking
G
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
answered
Junior Member

Do I have to add the database table through php fusion itself? I added the tables through my database admin. Maybe this is the reason they are not defined?
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

No, you don't have to add them via PHPFusion - it's ok you have added them manually via pphMyAdmin.

You should insert the code I posted above in the file /submit.php - you can eg; insert it in the top of the file - as long as it's above the constant ".DB_CLASSIFIED_CATS."
0 replies
G
gilesytheking
G
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
answered
Junior Member

So that has worked, but I have two database tables to define. Can I add the second database into that same bit of code?
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

Just add one code more similiar to the one i posted above. The second code you just put under the first code.

And of course change the constant in the socond code so it matches the database_field. ;)
0 replies
G
gilesytheking
G
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
answered
Junior Member

works great thanks, any chance you can have a look at some of my work? I am trying to make a submit page to add info to database tables then a page to view the submitted info. I have tried to base it on the submit weblinks and weblinks.php pages. I did start a thread but no 1 seems to want to help me. I have gotten so far but got stuck.
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

No problem.

Regarding:
"I did start a thread but no 1 seems to want to help me. I have gotten so far but got stuck."

- wicht thread is that/where ?

Then we can take it further in that thread - and not here.
0 replies
G
gilesytheking
G
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
answered
Junior Member

http://www.php-fusion.co.uk/forum/viewthread.php?thread_id=28237

This was my original thread.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Quote

gilesytheking wrote:
I did start a thread but no 1 seems to want to help me. I have gotten so far but got stuck.


Man, don't you think that your saying aren't right ?

Quote

From Code of Conduct :
Keep in mind that all Support Crew, Moderators and Administrators are regular members just like you and offer their support in their spare time. Please respect that and be patient, even if you don't receive an answer straight away. Remember that official technical support for PHPFusion is a privilege, not a right, according to our license PHPFusion comes with no warranty!


And if your Post is observed, you have made another Thread just after 4 hours. I don't think that this makes any sense about inactivity of Helpers or Support Staff or anyone.

You may better read the Code of Conduct first before posting in forums.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 9 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

S
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
G
G
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 18 threads in the forums
  • Started this discussions
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet