PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 8th, 2004, 03:24 PM
AZHTON AZHTON is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 AZHTON User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking plz are there something wrong in my code?

well i am trying to do a New's PORTAL

after my form i put this (the code from down) here the system show me an error ( WARNING mysql_fetch_array() )

FORMENTRYNEWS.PHP
PHP Code:
<?php
include("../libreria/coneccion.php");
$link=Conectarse();
$result mysql_query("select id_noticia, autor,titulo,fecha_cre,fecha_pub,doc_relac,resumen   from noticias"$link);
?>
<table border=1 cellspacing=1 cellpadding=1>
<TR><TD>&nbsp; id_noticia &nbsp;</td><TD>&nbsp; autor &nbsp;</td><TD>&nbsp; titulo &nbsp;</td><TD>&nbsp; fecha_cre &nbsp;</td><TD>&nbsp; fecha_pub &nbsp;</td>
<TD>&nbsp; doc_relac &nbsp;</td><TD>&nbsp; resumen &nbsp;</td></tr>
<?php
while ($row mysql_fetch_array($result)){
printf("<tr><td>&nbsp;%s</td><td>&nbsp;%s</td><td>&nbsp;%s</td><td>&nbsp;%s</td><td>&nbsp;%s</td><td>&nbsp;%s</td><td>&nbsp;%s</td></tr>",
$row["id_noticia"],$row["autor"],$row["titulo"],$row["fecha_cre"],$row["fecha_pub"],$row["doc_relac"],$row["resumen"]);
}
mysql_free_result($result);
mysql_close($link);
?>





then in my other CODE procesar.php the system show me an other error ( parse error, unexpected T_STRING )

my modest code =) is

PROCESAR.PHP

PHP Code:
<?php
include("../libreria/coneccion.php);
$link=conectarse();
mysql_query("
insert into noticias (id_noticia,autor,titulo,fecha_cre,fecha_pub,doc_r  elac,resumen)
values ('$id_noticia','$autor','$titulo','$fecha_cre','$f  echa_pub','$doc_relac','$resumen')",$link);
echo ("
insert into noticias (id_noticia,autor,titulo,fecha_cre,fecha_pub,doc_r  elac,resumen)
values ('$id_noticia','$autor','$titulo','$fecha_cre','$f  echa_pub','$doc_relac','$resumen')";
?>





GREETINGS TO EVERY BODY (i hope found answer to my doubts)

Reply With Quote
  #2  
Old November 8th, 2004, 06:26 PM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Canada
Posts: 330 Viper_SB User rank is Private First Class (20 - 50 Reputation Level)Viper_SB User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 h 51 m 6 sec
Reputation Power: 5
Your parse error is on your include line, you are missing the ending quote "
PHP Code:
// should be
include("../libreria/coneccion.php"); 

Also remove the ( from after echo

try this for the first one
PHP Code:
 $result mysql_query("select id_noticia, autor,titulo,fecha_cre,fecha_pub,doc_relac,resumen     from noticias"$link) or die('unkown error: '.mysql_error()); 

Remember to ALWAYS add erroring handling to your code.

Moved to PHP forum

Reply With Quote
  #3  
Old November 9th, 2004, 01:46 PM
AZHTON AZHTON is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 AZHTON User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yep thnkz

mi code works
again greetings to everybody

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > plz are there something wrong in my code?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway