Page 1 of 1

DB Error? [SOLVED]

PostPosted: Wed Jan 09, 2008 1:34 pm
Author: DjPorkchop
Hello all. I am working on a new mod for Integramod/Im Portal use. it is quite nice and works a treat for radio station websites.

My database works nice, EXCEPT i have 1 small minor issue that maybe some one can help with.

here is my db structure:

CREATE TABLE IF NOT EXISTS `request_song` (
`id` bigint(20) NOT NULL auto_increment,
`song` longtext NOT NULL,
`artist` longtext NOT NULL,
`name` longtext NOT NULL,
`shoutout` longtext NOT NULL,
`ip` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;

Nohere is the problem. everything shows up on the page properly as it should EXCEPT for shoutout. Not quite sure why it wont work.

A couple of screenshots to follow. (Click Images for large view)

Ok here goes in the first shot, you can see my request page ALL info was filled in before submit was selected.

[albumimg]28[/albumimg]


Now here is a shot of the requested songs page. Notice the shout out is empty? Its not even entered in the database either.

[albumimg]29[/albumimg]

The only thing I think besides an obvious db error is the fact that I need to go with a large text field somehow for shout outs.

Re: DB Error?

PostPosted: Thu Jan 10, 2008 11:58 am
Author: obiku
Are you sure you created your table correct??

If I look at the picture, it looks like your table is missing one cell. If the data was not inserted, that cell should be empty. (The cell does not have any border like the other ones).

Re: DB Error?

PostPosted: Thu Jan 10, 2008 6:23 pm
Author: DjPorkchop
Thats kinda what I was thinking as well. Originally, I did not in fact, have the shout out item in there. It was added after all was said and done.

I could just as easily remove it, but I think it just gives and extra incentive to get users to send in requests while tuning in to the radio station.

The reason I was guessing db error was like I said, everything is stored in the DB BUT the shout out.

I could post my code here, BUT....... <img> Not quite sure I want to let loose of that one yet. Was kinda trying to hold off until I get it done and working stable.

This is my first genuine honest to Bugs Bunny attempt at a mod for IM/phpBB it's definately trial & error type of situation. Id say Im REAL close like to having it "There"

Im also working on a new and improved shoutcast menu/block as well.

****EDIT****
Well, i thought about it and I really need this to work. Here is a snippet of code and the forming of the table as you all saw in the pic.

Code: Select all
$query = "SELECT * FROM request_song ORDER BY id ASC"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { $id = $row['id']; $song = $row['song']; $artist = $row['artist']; $name = $row['name'];$shoutout = $row['shoutout']; $ip = $row['ip']; echo "<tr><td>".$id."</td><td>".$song."</td><td>".$artist."</td><td>".$name."</td><td>".$ip."</td><td>".$shoutout."</td><td><a>Delete</a></td></tr>"; } ?>

Re: DB Error? [SOLVED]

PostPosted: Thu Jan 10, 2008 7:21 pm
Author: DjPorkchop
I think this case was like the nut you cant get started on the bolt. You walk away for a while and come back and it goes right on.

What the issue was, was, I forgot to insert the shout out into the DB when the submit button was pressed.

I added the insert into the code and all is well. The field now populates. <img>

Re: DB Error? [SOLVED]

PostPosted: Fri Jan 11, 2008 12:31 pm
Author: obiku
OK, glad you find the solution

Re: DB Error? [SOLVED]

PostPosted: Fri Jan 11, 2008 6:20 pm
Author: DjPorkchop
yeah and thank you for replying to the thread. I had put it on the back burner until you replied. Then I got thining about it after you said it was even missing the cell and I knew exaclty where to go look and sure enough, On submit, I was inserting everything into the db BUT the shout out. <img>

Now that it's solved, I can work on whooping it up into a releasable stable mod for radio websites.