Jump to content

deki

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

deki's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, When i put in the statement id=contacts.id It works and brings up all the results with the correct id links i.e. ?=1 (depending on which id i click on) but then it doesnt carry it over to the next page to show just that result
  2. Well you see this is the problem, when i take out the \"WHERE id=$id\" the page works, although doesnt carry the variables over to the next page. When i have that where statement there i get this displayed Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in c:apacheapachehtdocsdatabaseindex.php on line 11 Name Phone Mobile Fax E-mail Website
  3. Hey dude, Something i found tough when i was learning Coldfusion, which i have noticed applies the same with PHP, When displaying an image from a database it has to be in an image tag, for e.g. <img src=\"$images\"> Like that. Natrually you add the width and hight if needed. Hope it helps, but i am a newbie too. But try it out anyways. Cheers
  4. Hey, I have done what you asked. When i change it to id=4 or any other number, that actual id comes up only. Although when i echo out my $result i still get Resource id #3 This isnt lookking good. Does anyone have just a simple script i could look at where it has something likes this? A page that shows entries, you pick which one u want so u can edit or delete? Anyone?
  5. Ok, When i echo $result, i keep getting Resource id #3 no matter what id i pick =( I have no idea why! Helppppppppppppppppp!!!!!!
  6. Yes i know. But i just have no idea why nothing at all shows up when i add that WHERE statement in. It looks fine to me. but i have no idea whats going on nor why. I\'m trying to learn php, i know coldfusion, but i want to learn php, but this is just buggering me as in why it wont work :roll:
  7. Hey napper, Thanks for taking your time to try and help, this is buggering me becuase i tried what you said before, and just now again, and still no good. I dont know whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
  8. Hey guys, I am just learning php with MySQL and all i want to do is edit some users i have in the database, to do so, i want to click on a persons ID, then display it on the next page with the persons details and edit it. I\'m a little stuck, hopefully you guys will help me, This is what i have, just simply brings up all my entries. The problem is when i add in \"WHERE id=$id\" i get no entries come up at all! Stuffs me why, when i take that part out of the statement, it works! Here is my code, tell me what you guys think. <?php $username=""; $password=""; $database="test"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM contacts WHERE id=$id"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table border="0" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif">Name</font></th> <th><font face="Arial, Helvetica, sans-serif">Phone</font></th> <th><font face="Arial, Helvetica, sans-serif">Mobile</font></th> <th><font face="Arial, Helvetica, sans-serif">Fax</font></th> <th><font face="Arial, Helvetica, sans-serif">E-mail</font></th> <th><font face="Arial, Helvetica, sans-serif">Website</font></th> </tr> <? $i=0; while ($i < $num) { $first=mysql_result($result,$i,"first"); $last=mysql_result($result,$i,"last"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"mobile"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $web=mysql_result($result,$i,"web"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><? echo "$first $last"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$phone"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$mobile"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$fax"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><a href="mailto:<? echo "$email"; ?>">E-mail</a></font></td> <td><font face="Arial, Helvetica, sans-serif"><a href="<? echo "$web"; ?>">Website</a></font></td> </tr> <? ++$i; } echo "</table>"; Thanks guys. Cheers
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.