×
  • remind me tomorrow
  • remind me next week
  • never remind me
Subscribe to the ANN Newsletter • Wake up every Sunday to a curated list of ANN's most interesting posts of the week. read more

Forum - View topic
Newsfeed Help - PHP/MySQL problem




Anime News Network Forum Index -> Site-related -> Bugs & Technical Questions
View previous topic :: View next topic  
Author Message
Antz1982



Joined: 02 Mar 2006
Posts: 6
PostPosted: Thu Mar 02, 2006 5:02 pm Reply with quote
Okay, I've never in my puff used MySQL or php just so you all know Very Happy 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
View user's profile Send private message
Antz1982



Joined: 02 Mar 2006
Posts: 6
PostPosted: Thu Mar 02, 2006 7:36 pm Reply with quote
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
View user's profile Send private message
Antz1982



Joined: 02 Mar 2006
Posts: 6
PostPosted: Fri Mar 03, 2006 5:41 am Reply with quote
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
View user's profile Send private message
Dan42
Chief Encyclopedist


Joined: 02 Jan 2002
Posts: 3783
Location: Montreal
PostPosted: Fri Mar 03, 2006 6:59 am Reply with 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. 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
View user's profile Send private message Visit poster's website AIM Address My Anime My Manga
Antz1982



Joined: 02 Mar 2006
Posts: 6
PostPosted: Fri Mar 03, 2006 11:09 am Reply with quote
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
View user's profile Send private message
Tempest
I Run this place.
ANN Publisher


Joined: 29 Dec 2001
Posts: 10425
Location: Do not message me for support.
PostPosted: Fri Mar 03, 2006 11:54 am Reply with quote
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
View user's profile Send private message Send e-mail My Anime My Manga
Antz1982



Joined: 02 Mar 2006
Posts: 6
PostPosted: Sat Mar 04, 2006 8:35 am Reply with quote
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 Very Happy 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
View user's profile Send private message
Antz1982



Joined: 02 Mar 2006
Posts: 6
PostPosted: Sat Mar 04, 2006 9:50 am Reply with quote
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 Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Anime News Network Forum Index -> Site-related -> Bugs & Technical Questions All times are GMT - 5 Hours
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group