View previous topic :: View next topic |
Author |
Message |
|
Antz1982
Joined: 02 Mar 2006
Posts: 6
|
Posted: Thu Mar 02, 2006 5:02 pm
|
|
|
Okay, I've never in my puff used MySQL or php just so you all know I created a data base in MySQL Account Maintenance, then moved onto phpMyAdmin to create the tables. I named the new table annNews and asked it asked me to enter the number of fields(i just entered 1)&pressed "go".
Now this is where I dunno what to do next! Where do i put (last_query INT UNSIGNED NOT NULL, news TEXT NOT NULL );
and VALUES (0, ' ');
These are the column headers i have for my table in general (note: field and type are two different headings. wouldnt couldnt underline individual):
Field Type Length/Values* Collation Attributes Null Default** Extra
Even if someone helps me with all this there's still the task of putting it on frontpage2003 lol
Anybody? Help? Please!!
Cheers,
Antz
[Subject fixed -t]
|
Back to top |
|
|
Antz1982
Joined: 02 Mar 2006
Posts: 6
|
Posted: Thu Mar 02, 2006 7:36 pm
|
|
|
Quote: |
annNews is the table
the fields in the table are
last_query
Type: int(10)
Attrib: Unsigned
Null: No
Default: 0
news
Type: Text
Collation: latin1_swedish_ci (This was selected by default)
Null: No |
I found this on the forum. I didn't realise that (last_query INT UNSIGNED NOT NULL, news TEXT NOT NULL ); was meant for two different fields in the table.
Anyway, i managed to set the table up and i started to edit it with the php code but all i got was...
Quote: |
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?
// Connect to database
$mysql_connection = mysql_connect("localhost", "am' at line 1
|
I dont understand the part in bold as this isnt my mysql_user name. it changes to this when i test the script out. Anybody know what I've done wrong?
|
Back to top |
|
|
Antz1982
Joined: 02 Mar 2006
Posts: 6
|
Posted: Fri Mar 03, 2006 5:41 am
|
|
|
Okay, i've made some improvement. I saved the php code into a text document and in MySQL where i can view my data base i use the option "Insert data from a text file into the table" as opposed to just cutting and pasting the code EXACTLY as it was, including adjustments, to "Run SQL query/queries on database mydatabase_name" and running it which gave me the syntax error on line 1. option "Insert data from a text file into the table" i add my php text document saved on my comp, click the option to Replace table data with text file and this seems to return 33 rows of nothing, though it does contain the field headers of "last_query" & "news" with 0's under "last_query". I've contacted and they're going to open up their firewalls to me, so does this seem correct so far?
|
Back to top |
|
|
Dan42
Chief Encyclopedist
Joined: 02 Jan 2002
Posts: 3793
Location: Montreal
|
Posted: Fri Mar 03, 2006 6:59 am
|
|
|
Wow, you seem to have absolutely no idea what you're doing, and you're just stumbling randomly in the dark. That's a very good way to shoot yourself in the foot. I'll try to make this as simple as I can. Using phpMyAdmin:
1. Select the database you want to use in the left column
2. At the top of the main window, there should be a link titled "SQL". Click that.
3. You will be presented with a textbox saying something like "Run SQL query/queries on database [your database's name]:"
In that textbox, paste the following text exactly like this:
Code: | DROP TABLE IF EXISTS annNews;
CREATE TABLE annNews (last_query INT UNSIGNED NOT NULL, news TEXT NOT NULL );
INSERT INTO annNews VALUES (0, ' '); |
If you still can't figure it out with this, I can't help you.
|
Back to top |
|
|
Antz1982
Joined: 02 Mar 2006
Posts: 6
|
Posted: Fri Mar 03, 2006 11:09 am
|
|
|
Quote: | Wow, you seem to have absolutely no idea what you're doing, and you're just stumbling randomly in the dark. That's a very good way to shoot yourself in the foot. |
ol, I've never used MySQL before or any phpscript and reading the "HELP" menu with my hosting package made learning latin easy!! but cheers man. That seemed to work. I got 'Your SQL query has been executed successfully', though mySQL returned an empty result.
|
Back to top |
|
|
Tempest
I Run this place.
ANN Publisher
Joined: 29 Dec 2001
Posts: 10468
Location: Do not message me for support.
|
Posted: Fri Mar 03, 2006 11:54 am
|
|
|
Antz1982 wrote: | I got 'Your SQL query has been executed successfully', though mySQL returned an empty result. |
That's the answer you want.
You now have an empty table for the news that the script should be able to populate provided you get the script setup properly.
-t
|
Back to top |
|
|
Antz1982
Joined: 02 Mar 2006
Posts: 6
|
Posted: Sat Mar 04, 2006 8:35 am
|
|
|
Quote: | You now have an empty table for the news that the script should be able to populate provided you get the script setup properly. |
Cheers guys for your help. My sites still not published but it works on preview with frontpage2003 when connected to the net. One more question though then I'm done How do i set the hyper links to open up in another page without having to manually edit each hyper text? Or is this something i just need to do manually once the news is updated?
|
Back to top |
|
|
Antz1982
Joined: 02 Mar 2006
Posts: 6
|
Posted: Sat Mar 04, 2006 9:50 am
|
|
|
Quote: | How do i set the hyper links to open up in another page without having to manually edit each hyper text? Or is this something i just need to do manually once the news is updated? |
Its okay, i got. At least i learned something on my own lol
Cheers again guys and thanks for the newsfeed. Im looking forward to getting on the road myself now
|
Back to top |
|
|
|