Page 2 of 3

Posted: Tue Apr 19, 2005 7:36 pm
by Smackie

Posted: Tue Apr 19, 2005 8:42 pm
by hongco
in the case of delete, your $row['URL'] is blank, check in your database if url contains anything at all.

Posted: Tue Apr 19, 2005 8:51 pm
by Smackie
it has something in the data base which is

(id) (symbol) (Url) (Alt)
10 ;) wink.png wink.png

Posted: Tue Apr 19, 2005 8:55 pm
by hongco
in the delete case:
could you echo "my image should be: ".$row['Url'];
see what you get.

Posted: Tue Apr 19, 2005 9:00 pm
by Smackie
same thing there :S

Posted: Tue Apr 19, 2005 9:11 pm
by hongco
<a href="admin.php?mode=posting&smilie='.$row['id'].'">

i bet this line will have smilie = (blank) as well

Posted: Tue Apr 19, 2005 9:18 pm
by Smackie
yea it is

Posted: Tue Apr 19, 2005 9:26 pm
by hongco
in delete case:

could you change: while($row = mysql_fetch_array($query)){

to while($row = mysql_fetch_array($query,MYSQL_ASSOC)){

(MYSQL_ASSOC returns an associative array.)

Posted: Tue Apr 19, 2005 9:33 pm
by Smackie
yeah and still gives me the same thing

Posted: Tue Apr 19, 2005 9:43 pm
by hongco
it looks to me it doesn't return any row? how many rows did you get? Is the number of rows showing up as same as that of the database?

Posted: Tue Apr 19, 2005 9:45 pm
by Smackie
yeah there only one in the data base and there is one in the delete place

Posted: Wed Apr 20, 2005 12:06 am
by feyd
var_export() or var_dump() or print_r() $row to see what is actually being returned.

Posted: Wed Apr 20, 2005 4:17 am
by Smackie
Alright i fixed it here is what was wrong


Old code

Code: Select all

case 'delete':

			$query = mysql_query("SELECT * FROM smilies") or die(mysql_error());
			while($row = mysql_fetch_array($query)){ 
			
				echo '<a href="admin.php?mode=posting&smilie='.$row['id'].'">
		
			  <img src="smilies/'.$row['URL'].'" border="0" width="30" height="30" alt="'.$row['Alt'].'">
					  </a><br><br>
					  ';
New Code

Code: Select all

case 'delete':

			$query = mysql_query("SELECT * FROM smilies") or die(mysql_error());
			while($row = mysql_fetch_array($query)){ 
			
				echo '<a href="admin.php?mode=posting&smilie='.$row['id'].'">
		
			  <img src="smilies/'.$row['Alt'].'" border="0" width="30" height="30" alt="'.$row['Url'].'">
					  </a><br><br>
					  ';
<img src="smilies/'.$row['Alt'].'" border="0" width="30" height="30" alt="'.$row['Url'].'">
the smilies/'.$row['URL'] should have been Alt and the Alt one should have been URL........... :)

Thank you for helping me out
Smackie

Posted: Wed Apr 20, 2005 6:54 am
by feyd
sounds like your insert is goofy then..

Posted: Wed Apr 20, 2005 8:29 am
by Smackie
At least it works right? lol.... is there a way to make it refresh without flickering and messing up when you try typing?