PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Tue Apr 19, 2005 7:36 pm
hongco
Forum Contributor
Posts: 186 Joined: Sun Feb 20, 2005 2:49 pm
Post
by hongco » Tue Apr 19, 2005 8:42 pm
in the case of delete, your $row['URL'] is blank, check in your database if url contains anything at all.
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Tue Apr 19, 2005 8:51 pm
it has something in the data base which is
(id) (symbol) (Url) (Alt)
10
wink.png wink.png
hongco
Forum Contributor
Posts: 186 Joined: Sun Feb 20, 2005 2:49 pm
Post
by hongco » Tue Apr 19, 2005 8:55 pm
in the delete case:
could you echo "my image should be: ".$row['Url'];
see what you get.
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Tue Apr 19, 2005 9:00 pm
same thing there :S
hongco
Forum Contributor
Posts: 186 Joined: Sun Feb 20, 2005 2:49 pm
Post
by hongco » Tue Apr 19, 2005 9:11 pm
<a href="admin.php?mode=posting&smilie='.$row['id'].'">
i bet this line will have smilie = (blank) as well
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Tue Apr 19, 2005 9:18 pm
yea it is
hongco
Forum Contributor
Posts: 186 Joined: Sun Feb 20, 2005 2:49 pm
Post
by hongco » Tue Apr 19, 2005 9:26 pm
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.)
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Tue Apr 19, 2005 9:33 pm
yeah and still gives me the same thing
hongco
Forum Contributor
Posts: 186 Joined: Sun Feb 20, 2005 2:49 pm
Post
by hongco » Tue Apr 19, 2005 9:43 pm
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?
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Tue Apr 19, 2005 9:45 pm
yeah there only one in the data base and there is one in the delete place
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Apr 20, 2005 12:06 am
var_export() or var_dump() or print_r() $row to see what is actually being returned.
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Wed Apr 20, 2005 4:17 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Apr 20, 2005 6:54 am
sounds like your insert is goofy then..
Smackie
Forum Contributor
Posts: 302 Joined: Sat Jan 29, 2005 2:33 pm
Post
by Smackie » Wed Apr 20, 2005 8:29 am
At least it works right? lol.... is there a way to make it refresh without flickering and messing up when you try typing?