need help with confirm to delete page

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

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It looks like you are missing a serious chunk of your previous code that should be in there.
mikewooten
Forum Contributor
Posts: 169
Joined: Wed Feb 11, 2004 12:13 pm
Location: Duluth, Georgia
Contact:

Post by mikewooten »

what should i add for this to work for there not to be any errors?
thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

pretty much... starting with the original version you posted, modify the case statements, not the switch statement, the individual case statements, where all your function calls happen.. with the code I talked about. That's a start. I'm not doing it all for you, otherwise you're not learning.
mikewooten
Forum Contributor
Posts: 169
Joined: Wed Feb 11, 2004 12:13 pm
Location: Duluth, Georgia
Contact:

Post by mikewooten »

i modified the code with the suggestions that you gave me and and it still comes up with the same errors.
what should i try for this to work?
thanks
mikewooten
Forum Contributor
Posts: 169
Joined: Wed Feb 11, 2004 12:13 pm
Location: Duluth, Georgia
Contact:

?

Post by mikewooten »

?
zenabi
Forum Commoner
Posts: 84
Joined: Mon Sep 08, 2003 5:26 am
Location: UK

Post by zenabi »

Only have the following code on your php page:

Code: Select all

<?php
$dbname = "database"; 
$tblname = "items"; 

$linkid = mysql_connect("localhost", "username", "password") or die(mysql_error());  

$db = mysql_select_db($dbname, $linkid) or die(mysql_error());  


$query = mysql_query("SELECT * FROM items WHERE itemId='$itemId'") or die(mysql_error()); 
 
$num=mysql_num_rows($query) or die(mysql_error());

echo $num;

?>
Do you still get errors now?

(As a side note, please be patient and don't "bump" up your posts.)
mikewooten
Forum Contributor
Posts: 169
Joined: Wed Feb 11, 2004 12:13 pm
Location: Duluth, Georgia
Contact:

Post by mikewooten »

i used the code that you posted, and i had only that code on a php page, and when i viewed the file, there were no errors, and there was no output either, the page came up blank., i don't know why the page came up blank? i think there should of been some output that displayed on the page.?
thanks
zenabi
Forum Commoner
Posts: 84
Joined: Mon Sep 08, 2003 5:26 am
Location: UK

Post by zenabi »

Yes there should have been something at least.

Are you sure the path to your server should be localhost?
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

if thats all the code you used

$itemId isnt even defined.

You really need to read some tutorials and not expect people to write it all for you, unless of course - your compensating them.

:roll: :roll:
mikewooten
Forum Contributor
Posts: 169
Joined: Wed Feb 11, 2004 12:13 pm
Location: Duluth, Georgia
Contact:

Post by mikewooten »

I am sure the path to my server is localhost?
why do you think that there is nothing displaying when i vew the page?
thanks
zenabi
Forum Commoner
Posts: 84
Joined: Mon Sep 08, 2003 5:26 am
Location: UK

Post by zenabi »

tim wrote:$itemId isnt even defined.
Oops I was meant to take that WHERE clause out of my example code :oops:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Something to try...

Post by RobertGonzalez »

i used the code that you posted, and i had only that code on a php page, and when i viewed the file, there were no errors, and there was no output either, the page came up blank., i don't know why the page came up blank? i think there should of been some output that displayed on the page.?
thanks
Do you have access to phpMyadmin? If so, try running your query using the phpMyadmin SQL window. That may give you an error message that might help direct you a little better. From time to time I get errors like that. When $result is not a valid argument it could be that the query you are running is not handling itself right in mySql.

Just a thought.
Post Reply