Jump to content
php.lv forumi

Keywords nolasīšana no DB.


RobertsB

Recommended Posts

nu tātad uzliku ka keywordi saglabāti tiek DB un tos var jebkurā laikā editēt no lapas bet sis tas nesanaak.

 

 

nu tad es uztaisiju sadu funkciju ar kodu kas nolasa no DB tos keywordus

 function keywords() {

$res = mysql_query("SELECT * FROM keywords");

{
while($array = mysql_fetch_array($res))
{
print("".format_comment($array["words"])."");


 }

}
 }

bet ka lai attelo to funkciju šajā kodā ?

<meta name="KEYWORDS" content="bla , bla , bla "/>

 

provēju

content="keywords();"/

content="<? keywords(); ?>"/

bet kad uzspiežu view source tad pie keywordiem raadaas

<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'ODBC'@'localhost' (using password: NO) in <b>C:\Program Files\xampp\htdocs\inc\main.php</b> on line <b>48</b><br />
<br />
<b>Warning</b>:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>C:\Program Files\xampp\htdocs\inc\main.php</b> on line <b>48</b><br />
<br />
<b>Warning</b>:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>C:\Program Files\xampp\htdocs\inc\main.php</b> on line <b>51</b><br />

 

ka lai pareizi vinu nodefinee?

nez kape vins brec ka nav atljauts pieslegties mysql serverim.

Edited by RobertsB
Link to comment
Share on other sites

Tur skaidri rakstīts, kāda vaina ir tam, ka nevari pieslēgties serverim:

Access denied for user 'ODBC'@'localhost' (using password: NO)

Tu lietotājam ODBC nenorādi paroli, taču viņam vai nu ir uzlikta parole, vai arī viņš ir nobloķēts MySQLā. Tiec ar šo vispirms galā pirms drukāt keywordus.

Link to comment
Share on other sites

×
×
  • Create New...