login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Foutmelding plaatsen (Opgelost)

Offline staic - 09/06/2009 11:59
Avatar van staicNieuw lid Hoe plaats je een bericht wanneer er geen foto aanwezig is?

Met onderstaande code lees ik mijn foto uit:
  1. echo "<td><img width=70 src=uploads/" . $row['foto3'] . "></td>";


Wanneer er geen foto is toont hij het beroemde 'rode kruisje'. Dit zou ik graag vervangen door een bericht zoals bijvoorbeeld 'geen foto'.

Hoe doe ik dit?

21 antwoorden

Gesponsorde links
Offline ArieMedia - 09/06/2009 12:02 (laatste wijziging 09/06/2009 12:02)
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
alt=""

Bijv: <img width=70 src=uploads/" . $row['foto3'] . " alt="Geen foto">
Offline Martijn - 09/06/2009 12:02 (laatste wijziging 09/06/2009 12:03)
Avatar van Martijn Crew PHP
  1. echo "<td>";
  2. if(file_exists("uploads/" . $row['foto3']){
  3. echo"<img width=70 src=uploads/" . $row['foto3'] . ">";
  4. }
  5. else{
  6. echo "geen foto";
  7. }
  8. echo"</td>";


edit:
De alt kan ook, maar de alt is eigenlijk een omschrijving van de foto, die bv google gebruik voor content.

edit2:
het gaat dus om de PHP.net: file_exists (<-klik) functie
Offline ArieMedia - 09/06/2009 12:04 (laatste wijziging 09/06/2009 12:05)
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
DeviourSoul schreef:
[..code..]

edit:
De alt kan ook, maar de alt is eigenlijk een omschrijving van de foto, die bv google gebruik voor content.

edit2:
het gaat dus om de PHP.net: file_exists (<-klik) functie
Joah, Ik dacht later ook van, hee PHP-sectie.

Maargoed de omschrijving van wat hij wil kan wel wat duidelijker en in eerste instantie dacht ik dus aan alt .
Edit: Hij werkt ook nog met DB, dus misschien bedoelt hij zelfs als het veld foto3 leeg is. in dat geval gebruik je weer PHP.net: empty
Offline staic - 09/06/2009 12:46
Avatar van staic Nieuw lid Ik werk inderdaad met DB, zal in het vervolg proberen van zo duidelijk mogelijk te zijn.

Aangezien ik met DB werk zal ik moeten gebruik maken van PHP.net: empty.

Mijn code:

  1. <em></em><?php
  2. $con = mysql_connect("localhost","***","***");
  3. if (!$con)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7.  
  8. mysql_select_db("raamdecora_db1", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM klanten ORDER BY firma") or die(mysql_error());
  11.  
  12. echo "<table border='1'>
  13. <tr>
  14. <th>ID</th>
  15. <th>Firma</th>
  16. <th>Straat</th>
  17. <th>Postcode</th>
  18. <th>Stad</th>
  19. <th>Tel</th>
  20. <th>Email</th>
  21. <th>Website</th>
  22. <th>Groep binnenzonwering</th>
  23. <th>Groep buitenzonwering</th>
  24. <th>Groep gordijnstoffen</th>
  25. <th>Foto1</th>
  26. <th>view1</th>
  27. <th>Foto2</th>
  28. <th>view2</th>
  29. <th>Foto3</th>
  30. <th>view3</th>
  31. <th>Wijzig</th>
  32. <th>Verwijder</th>
  33. </tr>";
  34.  
  35. while($row = mysql_fetch_array($result))
  36. {
  37. echo "<tr>";
  38. echo "<td>" . $row['firmaID'] . "</td>";
  39. echo "<td><a href=klanten_info.php?firmaID=" . $row['firmaID'] . ">" . $row['firma'] . "</a></td>";
  40. echo "<td>" . $row['straat'] . "</td>";
  41. echo "<td>" . $row['postcode'] . "</td>";
  42. echo "<td>" . $row['stad'] . "</td>";
  43. echo "<td>" . $row['tel'] . "</td>";
  44. echo "<td>" . $row['email'] . "</td>";
  45. echo "<td>" . $row['website'] . "</td>";
  46. echo "<td>" . $row['groep_binnen'] . "</td>";
  47. echo "<td>" . $row['groep_buiten'] . "</td>";
  48. echo "<td>" . $row['groep_gordijnstoffen'] . "</td>";
  49. echo "<td>" . $row['foto1'] . "</td>";
  50. echo "<td><img width=70 src=uploads/" . $row['foto1'] . "></td>";
  51. echo "<td>" . $row['foto2'] . "</td>";
  52. echo "<td><img width=70 src=uploads/" . $row['foto2'] . "></td>";
  53. echo "<td>" . $row['foto3'] . "</td>";
  54. echo "<td>";if(empty("uploads/" . $row['foto3']){ echo"<img width=70 src=uploads/" . $row['foto3'] . ">"; }else{ echo "geen foto"; }echo"</td>";
  55. echo "<td><a href=klanten_wijzigen.php?firmaID=" . $row['firmaID'] . ">wijzig</a></td>";
  56. echo "<td><a href=klanten_verwijderen.php?firmaID=" . $row['firmaID'] . ">verwijder</a></td>";
  57. echo "</tr>";
  58. }
  59. echo "</table>";
  60.  
  61. ?>


Mijn foutmelding:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '$' in /home/raamdecora/domains/raamdecoratie.be/public_html/uitlezen.php on line 56
Offline Abbas - 09/06/2009 12:53 (laatste wijziging 09/06/2009 12:55)
Avatar van Abbas Gouden medaille

Crew .NET
Mag het wel om een if-regel te beginnen nadat je al echo() doet? Krijg je ook een foutmelding als je bijvoorbeeld dit doet:

  1. echo "<td>";
  2. if(empty("uploads/" . $row['foto3'])
  3. {
  4. echo "<img width='70' src='uploads/" . $row['foto3'] . "'>";
  5. }
  6. else
  7. {
  8. echo "geen foto";
  9. }
  10. echo "</td>";

Je bent ook single quotes vergeten te zetten rond de waardes van je img-parameters. Ook denk ik dat je if niet helemaal juist zit. Bij if(empty()) ga je toch de foto laten zien en bij else (niet empty) ga je zeggen: geen foto's...
Offline Wim - 09/06/2009 12:57 (laatste wijziging 09/06/2009 12:57)
Avatar van Wim Crew algemeen Ja hoor, dat mag. Hij is enkel een ) vergeten bij de if-lus. Je hebt enkel het ) geplaatst van empty 

Beter is echter wel om met PHP.net: file_exist te werken. Zo weet je zeker of de figuur wel écht bestaat.

//edit:
empty("uploads/" . $row['foto3'])

Dat gaat altijd false opleveren. Als $row['foto3'] leeg is staat er namelijk nog steeds "uploads/" in, en dat is niet leeg (empty)
Offline ArieMedia - 09/06/2009 13:05 (laatste wijziging 09/06/2009 13:18)
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
  1. if(empty($row['foto3'])) {
  2. $foto = 'Geen foto';
  3. } else {
  4. if(file_exists('uploads/'.$row['foto3'])) {
  5. $foto = 'uploads/'.$row['foto3'];
  6. } else $foto = 'Geen foto';
  7. }


Nu wel met beide controle's goed
Zet je If voor de tabel neer en op de plek waar de foto komt te staan roep je variabele foto aan.

Offline Wim - 09/06/2009 13:13
Avatar van Wim Crew algemeen beide controles is volledig nutteloos.... Als $row['foto3'] leeg is zal het bestand ook nooit bestaan.
Offline ArieMedia - 09/06/2009 13:15 (laatste wijziging 09/06/2009 13:17)
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
wimmarien schreef:
beide controles is volledig nutteloos.... Als $row['foto3'] leeg is zal het bestand ook nooit bestaan.
Klopt, even niet aan gedacht xD lol

Edit: Zoals het nu is, heeft het wel nu 
Offline staic - 09/06/2009 13:21 (laatste wijziging 09/06/2009 13:25)
Avatar van staic Nieuw lid HMMMZ... Heb het voor mekaar gekregen om te werken met file_exists en ) toe te voegen. (was idd eentje vergeten)

NU krijg ik wel nog altijd een rood kruisje te zien wanneer er geen foto werd toegevoegd How comes? Heeft dit ook te zien zoals wimmarien me wist te vertellen over de map "uploads/"? Hoe los ik dit dan op?

  1. <?php
  2. $con = mysql_connect("localhost","***","***");
  3. if (!$con)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7.  
  8. mysql_select_db("raamdecora_db1", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM klanten ORDER BY firma") or die(mysql_error());
  11.  
  12. echo "<table border='1'>
  13. <tr>
  14. <th>ID</th>
  15. <th>Firma</th>
  16. <th>Straat</th>
  17. <th>Postcode</th>
  18. <th>Stad</th>
  19. <th>Tel</th>
  20. <th>Email</th>
  21. <th>Website</th>
  22. <th>Groep binnenzonwering</th>
  23. <th>Groep buitenzonwering</th>
  24. <th>Groep gordijnstoffen</th>
  25. <th>Foto1</th>
  26. <th>view1</th>
  27. <th>Foto2</th>
  28. <th>view2</th>
  29. <th>Foto3</th>
  30. <th>view3</th>
  31. <th>Wijzig</th>
  32. <th>Verwijder</th>
  33. </tr>";
  34.  
  35. while($row = mysql_fetch_array($result))
  36. {
  37. echo "<tr>";
  38. echo "<td>" . $row['firmaID'] . "</td>";
  39. echo "<td><a href=klanten_info.php?firmaID=" . $row['firmaID'] . ">" . $row['firma'] . "</a></td>";
  40. echo "<td>" . $row['straat'] . "</td>";
  41. echo "<td>" . $row['postcode'] . "</td>";
  42. echo "<td>" . $row['stad'] . "</td>";
  43. echo "<td>" . $row['tel'] . "</td>";
  44. echo "<td>" . $row['email'] . "</td>";
  45. echo "<td>" . $row['website'] . "</td>";
  46. echo "<td>" . $row['groep_binnen'] . "</td>";
  47. echo "<td>" . $row['groep_buiten'] . "</td>";
  48. echo "<td>" . $row['groep_gordijnstoffen'] . "</td>";
  49. echo "<td>" . $row['foto1'] . "</td>";
  50. echo "<td><img width=70 src=uploads/" . $row['foto1'] . "></td>";
  51. echo "<td>" . $row['foto2'] . "</td>";
  52. echo "<td><img width=70 src=uploads/" . $row['foto2'] . "></td>";
  53. echo "<td>" . $row['foto3'] . "</td>";
  54. echo "<td>";if(file_exists("uploads/" . $row['foto3'])){ echo"<img width=70 src='uploads/" . $row['foto3'] . "'>"; }else{ echo "geen foto"; }echo"</td>";
  55. echo "<td><a href=klanten_wijzigen.php?firmaID=" . $row['firmaID'] . ">wijzig</a></td>";
  56. echo "<td><a href=klanten_verwijderen.php?firmaID=" . $row['firmaID'] . ">verwijder</a></td>";
  57. echo "</tr>";
  58. }
  59. echo "</table>";
  60.  
  61. ?>


//EDIT

met onderstaande code zie ik ook nog altijd rood kruisje en geen foutmelding.
  1. if(empty($row['foto3'])) { $foto = 'Geen foto';} else { if(file_exists('uploads/'.$row['foto3'])) { $foto = 'uploads/'.$row['foto3']; } else $foto = 'Geen foto';}
Offline ArieMedia - 09/06/2009 13:27
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
Als je if(empty) vervangt met if($row['foto3'] == NULL) ?

Wat is het resultaat van print_r($row)?
Offline staic - 09/06/2009 13:34
Avatar van staic Nieuw lid Oeps.. hij toont dus geen rood kruisje, maar hij toont de foto ook niet wanneer er wel eentje staat. Dus ik zie dus altijd 'geen foto' met onderstaande code:

  1. <?php
  2. $con = mysql_connect("localhost","***","***");
  3. if (!$con)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7.  
  8. mysql_select_db("raamdecora_db1", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM klanten ORDER BY firma") or die(mysql_error());
  11.  
  12.  
  13. if(empty($row['foto3'])) {
  14. $foto = 'Geen foto';
  15.  
  16. } else {
  17.  
  18. if(file_exists('uploads/'.$row['foto3'])) {
  19.  
  20. $foto = 'uploads/'.$row['foto3'];
  21.  
  22. } else $foto = 'Geen foto';
  23.  
  24. }
  25.  
  26. echo "<table border='1'>
  27. <tr>
  28. <th>ID</th>
  29. <th>Firma</th>
  30. <th>Straat</th>
  31. <th>Postcode</th>
  32. <th>Stad</th>
  33. <th>Tel</th>
  34. <th>Email</th>
  35. <th>Website</th>
  36. <th>Groep binnenzonwering</th>
  37. <th>Groep buitenzonwering</th>
  38. <th>Groep gordijnstoffen</th>
  39. <th>Foto1</th>
  40. <th>view1</th>
  41. <th>Foto2</th>
  42. <th>view2</th>
  43. <th>Foto3</th>
  44. <th>view3</th>
  45. <th>Wijzig</th>
  46. <th>Verwijder</th>
  47. </tr>";
  48.  
  49. while($row = mysql_fetch_array($result))
  50. {
  51. echo "<tr>";
  52. echo "<td>" . $row['firmaID'] . "</td>";
  53. echo "<td><a href=klanten_info.php?firmaID=" . $row['firmaID'] . ">" . $row['firma'] . "</a></td>";
  54. echo "<td>" . $row['straat'] . "</td>";
  55. echo "<td>" . $row['postcode'] . "</td>";
  56. echo "<td>" . $row['stad'] . "</td>";
  57. echo "<td>" . $row['tel'] . "</td>";
  58. echo "<td>" . $row['email'] . "</td>";
  59. echo "<td>" . $row['website'] . "</td>";
  60. echo "<td>" . $row['groep_binnen'] . "</td>";
  61. echo "<td>" . $row['groep_buiten'] . "</td>";
  62. echo "<td>" . $row['groep_gordijnstoffen'] . "</td>";
  63. echo "<td>" . $row['foto1'] . "</td>";
  64. echo "<td><img width=70 src=uploads/" . $row['foto1'] . "></td>";
  65. echo "<td>" . $row['foto2'] . "</td>";
  66. echo "<td><img width=70 src=uploads/" . $row['foto2'] . "></td>";
  67. echo "<td>" . $row['foto3'] . "</td>";
  68. echo "<td>" . $foto . "</td>";
  69. echo "<td><a href=klanten_wijzigen.php?firmaID=" . $row['firmaID'] . ">wijzig</a></td>";
  70. echo "<td><a href=klanten_verwijderen.php?firmaID=" . $row['firmaID'] . ">verwijder</a></td>";
  71. echo "</tr>";
  72. }
  73. echo "</table>";
  74.  
  75. ?>
Offline Wim - 09/06/2009 13:37
Avatar van Wim Crew algemeen Je maakt het jezelf ook lastig....
  1. if(empty($row['foto3'])) {
  2. $foto = 'Geen foto';
  3.  
  4. } else {
  5.  
  6. if(file_exists('uploads/'.$row['foto3'])) {
  7.  
  8. $foto = 'uploads/'.$row['foto3'];
  9.  
  10. } else $foto = 'Geen foto';
  11.  
  12. }


mag je vervangen door volgende code, die is korter, overzichtelijker en doet hetzelfde:
  1. if(file_exists('uploads/'.$row['foto3']))
  2. {
  3. $foto = 'uploads/'.$row['foto3'];
  4. } else
  5. {
  6. $foto = 'Geen foto';
  7. }


Verder, deze code moet in je while-lus staan. (tussen lijn 51 en 73 dus).

Als het dan nog niet werkt moet je eens proberen om $foto te echo'en en te kijken wat het resultaat is.
Offline staic - 09/06/2009 14:22
Avatar van staic Nieuw lid Ik heb de code van wimmarien(zie hierboven) geïntegreerd voor mijn foto3.

Resultaat: http://www.raamdecoratie.be/uitlezen2.php
(zoals je kan zien is er geen foto aanwezig voor foto3 en toont hij niet 'geen foto' maar toont hij terug een rood kruisje. De echo van de variabele is ook aanwezig op http://www.raamdecoratie.be/uitlezen2.php zoals wimmarien heeft gevraagd.

Code:
  1. <?php
  2. $con = mysql_connect("localhost","***","***");
  3. if (!$con)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7.  
  8. mysql_select_db("raamdecora_db1", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM klanten ORDER BY firma") or die(mysql_error());
  11.  
  12. echo "<table border='1'>
  13. <tr>
  14. <th>ID</th>
  15. <th>Firma</th>
  16. <th>Straat</th>
  17. <th>Postcode</th>
  18. <th>Stad</th>
  19. <th>Tel</th>
  20. <th>Email</th>
  21. <th>Website</th>
  22. <th>Groep binnenzonwering</th>
  23. <th>Groep buitenzonwering</th>
  24. <th>Groep gordijnstoffen</th>
  25. <th>Foto1</th>
  26. <th>view1</th>
  27. <th>Foto2</th>
  28. <th>view2</th>
  29. <th>Foto3</th>
  30. <th>view3</th>
  31. <th>Wijzig</th>
  32. <th>Verwijder</th>
  33. </tr>";
  34.  
  35. while($row = mysql_fetch_array($result))
  36. {
  37. echo "<tr>";
  38. echo "<td>" . $row['firmaID'] . "</td>";
  39. echo "<td><a href=klanten_info.php?firmaID=" . $row['firmaID'] . ">" . $row['firma'] . "</a></td>";
  40. echo "<td>" . $row['straat'] . "</td>";
  41. echo "<td>" . $row['postcode'] . "</td>";
  42. echo "<td>" . $row['stad'] . "</td>";
  43. echo "<td>" . $row['tel'] . "</td>";
  44. echo "<td>" . $row['email'] . "</td>";
  45. echo "<td>" . $row['website'] . "</td>";
  46. echo "<td>" . $row['groep_binnen'] . "</td>";
  47. echo "<td>" . $row['groep_buiten'] . "</td>";
  48. echo "<td>" . $row['groep_gordijnstoffen'] . "</td>";
  49. echo "<td>" . $row['foto1'] . "</td>";
  50. echo "<td><img width=70 src=uploads/" . $row['foto1'] . "></td>";
  51. echo "<td>" . $row['foto2'] . "</td>";
  52. echo "<td><img width=70 src=uploads/" . $row['foto2'] . "></td>";
  53. echo "<td>" . $row['foto3'] . "</td>";
  54. if(file_exists('uploads/'.$row['foto3']))
  55. {
  56. $fotovari3 = '<img src=uploads/'.$row['foto3'].">";
  57. } else
  58. {
  59. $fotovari3 = 'Geen foto';
  60. }
  61. echo "<td>" . $fotovari3 . "</td>";
  62. echo "<td><a href=klanten_wijzigen.php?firmaID=" . $row['firmaID'] . ">wijzig</a></td>";
  63. echo "<td><a href=klanten_verwijderen.php?firmaID=" . $row['firmaID'] . ">verwijder</a></td>";
  64. echo "</tr>";
  65. }
  66. echo "</table>";
  67.  
  68. echo "<b>is de echo van fotovari3:</b>&nbsp;" . $fotovari3;
  69.  
  70. ?>
Offline ArieMedia - 09/06/2009 14:27
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
Doe eens print_r($row) in de while
Offline Wim - 09/06/2009 14:30 (laatste wijziging 09/06/2009 14:31)
Avatar van Wim Crew algemeen
  1. $fotovari3 = '<img src=uploads/'.$row['foto3'].">";

=>
  1. $fotovari3 = '<img src="uploads/'.$row['foto3'].'">';


@Arie: als je in zijn broncode kijkt zie je dat $row['foto3'] de waarde "wtf.jpg" heeft...
Offline ArieMedia - 09/06/2009 14:33 (laatste wijziging 09/06/2009 14:35)
Avatar van ArieMedia Gouden medaille

PHP ver gevorderde
wimmarien schreef:
[..code..]
=>
[..code..]

@Arie: als je in zijn broncode kijkt zie je dat $row['foto3'] de waarde "wtf.jpg" heeft...
In firefox > Rechtsklik > Afbeeldingslocatie kopieren. dan is de URL: http://www.raamdecoratie.be/uploads/

Dus $row['foto3'] is leeg. De controle doet het dus helemaal niet.

Jij bekijkt foto1, maar we hebben het hier over veld Foto3
Offline staic - 09/06/2009 15:33 (laatste wijziging 09/06/2009 15:33)
Avatar van staic Nieuw lid
Arie2Zero schreef:
Doe eens print_r($row) in de while


Kun je nu zien. -> http://www.raamdecoratie.be/uitlezen2.php

Vreemd éh? Als ik zo de code lees (als newbie) dan ziet het er toch wel correct uit. Toch moet er iets mis zijn..

Code is nu:

  1. <?php
  2. $con = mysql_connect("localhost","***","***");
  3. if (!$con)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7.  
  8. mysql_select_db("raamdecora_db1", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM klanten ORDER BY firma") or die(mysql_error());
  11.  
  12. echo "<table border='1'>
  13. <tr>
  14. <th>ID</th>
  15. <th>Firma</th>
  16. <th>Straat</th>
  17. <th>Postcode</th>
  18. <th>Stad</th>
  19. <th>Tel</th>
  20. <th>Email</th>
  21. <th>Website</th>
  22. <th>Groep binnenzonwering</th>
  23. <th>Groep buitenzonwering</th>
  24. <th>Groep gordijnstoffen</th>
  25. <th>Foto1</th>
  26. <th>view1</th>
  27. <th>Foto2</th>
  28. <th>view2</th>
  29. <th>Foto3</th>
  30. <th>view3</th>
  31. <th>Wijzig</th>
  32. <th>Verwijder</th>
  33. </tr>";
  34.  
  35. while($row = mysql_fetch_array($result))
  36. {
  37. echo print_r($row);
  38. echo "<tr>";
  39. echo "<td>" . $row['firmaID'] . "</td>";
  40. echo "<td><a href=klanten_info.php?firmaID=" . $row['firmaID'] . ">" . $row['firma'] . "</a></td>";
  41. echo "<td>" . $row['straat'] . "</td>";
  42. echo "<td>" . $row['postcode'] . "</td>";
  43. echo "<td>" . $row['stad'] . "</td>";
  44. echo "<td>" . $row['tel'] . "</td>";
  45. echo "<td>" . $row['email'] . "</td>";
  46. echo "<td>" . $row['website'] . "</td>";
  47. echo "<td>" . $row['groep_binnen'] . "</td>";
  48. echo "<td>" . $row['groep_buiten'] . "</td>";
  49. echo "<td>" . $row['groep_gordijnstoffen'] . "</td>";
  50. echo "<td>" . $row['foto1'] . "</td>";
  51. echo "<td><img width=70 src=uploads/" . $row['foto1'] . "></td>";
  52. echo "<td>" . $row['foto2'] . "</td>";
  53. echo "<td><img width=70 src=uploads/" . $row['foto2'] . "></td>";
  54. echo "<td>" . $row['foto3'] . "</td>";
  55. if(file_exists('uploads/'.$row['foto3']))
  56. {
  57. $fotovari3 = '<img width=70 src=uploads/'.$row['foto3'].">";
  58. } else
  59. {
  60. $fotovari3 = 'Geen foto';
  61. }
  62. echo "<td>" . $fotovari3 . "</td>";
  63. echo "<td><a href=klanten_wijzigen.php?firmaID=" . $row['firmaID'] . ">wijzig</a></td>";
  64. echo "<td><a href=klanten_verwijderen.php?firmaID=" . $row['firmaID'] . ">verwijder</a></td>";
  65. echo "</tr>";
  66. }
  67. echo "</table>";
  68.  
  69. echo "<b>is de echo van fotovari3:</b>&nbsp;" . $fotovari3;
  70.  
  71.  
  72. ?>
Offline Wim - 09/06/2009 15:37 (laatste wijziging 09/06/2009 15:40)
Avatar van Wim Crew algemeen foto3 is leeg in je database....

//edit:
Je kan trouwens beter gebruik maken van PHP.net: mysql_fetch_assoc ipv PHP.net: mysql_fetch_array. _array bevat namelijk dubbel zoveel waardes (elke waarde dubbel. 1x met de key <veldnaam> en 1x met de key <veldnr>). _assoc geeft enkel de key met de veldnaam, welke de enigste is die jij gebruikt ;)
Offline staic - 09/06/2009 15:41
Avatar van staic Nieuw lid
wimmarien schreef:
foto3 is leeg in je database....


Die is inderdaad leeg. Is de bedoeling anders kan ik het niet testen.

Doelstelling: -> Wanneer het veld foto3 leeg is moet er bij foto3 de melding 'geen foto' komen te staan. Dat is de reden dat foto3 leeg is.

Snap je?

Offline Wim - 09/06/2009 16:14
Avatar van Wim Crew algemeen en zo?
  1. if(file_exists('uploads/'.$row['foto3']) && !is_dir('uploads/'.$row['foto3']))
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.367s