Miscellaneous > Programming & Networking

Database

<< < (2/3) > >>

Calum:
might i add, and i am a novice, so slap my wrists if this is not it, but if you have a look at the database behind there, there's no tables in it except one called 'mysql_bookmarks' or similar.

presumably you need to create the relevant entries for it to work? i would have done this but as i say, i am a novice, and cannot pick out from that code what is a table, what is a field, et cetera...

voidmain:
Calum, I am guessing that Quirk is testing on a different machine which contains the appropriate database/table/rows and was having trouble getting the test code to work.  But yes, in order for the test code to work, several prerequisites need to be resolved.

According to the code that Quirk showed us I can tell you that there needs to be a MySQL server installed and running on the machine that the code is being executed on. There needs to be a MySQL database created called "faqfuckmicrosoft_uk_db", containing a table called "MES_FAQ" containing at least the following columns named: id, title, author, content, title, and date. In addition, a MySQL username and password must exist that matches the ID and password Quirk uses in the "mysql_connect()" function and that ID must have been granted at least "select" permissions to the database/table.

Now, since I have Apache/PHP/MySQL all installed on all of my machines I just created such a database/table/ID/permissions in MySQL on my laptop, then added a few rows of data to test with, copied his code into a *.php file on my laptop under my web root, set the ID/Password in the code to match what I created in my database and the code displayed the data in the table just fine. So his code is correct, I can't know if the database is set up right in his test environment but I assume it is.

[ September 17, 2002: Message edited by: void main ]

Calum:
well he uploaded his php script to that url i gave, so i assumed there would be no point in his doing so if he was testing it elsewhere since that's the faqfuckmicrosoft.com test website. For my own tinkering, if somebody doesn't beat me to it, i might try and setup a table such as you describe in the relevant location and see how it goes.

Gooseberry Clock:
Try naming the file "index.php".

voidmain:
Good catch RRS, I didn't even notice the link Calum gave was *.html.  It is true you must have a *.php extension and is the very first thing that is wrong. Of course, it is also true that the database/table/colums/data/user/permissions must also exist.

And now that you have exposed the source through that html file you are going to want to immediately change the ID/Password you use in your MySQL database....

[ September 17, 2002: Message edited by: void main ]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version