Page 2 of 2
Posted: Tue May 18, 2004 9:39 pm
by feyd
It looks like you are missing a serious chunk of your previous code that should be in there.
Posted: Tue May 18, 2004 10:21 pm
by mikewooten
what should i add for this to work for there not to be any errors?
thanks
Posted: Tue May 18, 2004 10:27 pm
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.
Posted: Tue May 18, 2004 10:53 pm
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
?
Posted: Wed May 19, 2004 6:52 am
by mikewooten
?
Posted: Wed May 19, 2004 12:17 pm
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.)
Posted: Wed May 19, 2004 2:53 pm
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
Posted: Wed May 19, 2004 5:37 pm
by zenabi
Yes there should have been something at least.
Are you sure the path to your server should be localhost?
Posted: Wed May 19, 2004 5:41 pm
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.

Posted: Wed May 19, 2004 9:14 pm
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
Posted: Thu May 20, 2004 4:39 pm
by zenabi
tim wrote:$itemId isnt even defined.
Oops I was meant to take that WHERE clause out of my example code

Something to try...
Posted: Thu May 20, 2004 6:40 pm
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.