Jump to content
php.lv forumi

mysql


xerts

Recommended Posts

Sveiks

 

man ir jautajums ka var iznemt datus no vienas db un no otras

piemeram

 

DB_country

country_id 1

country_name Latvia

country_img lv.gif

 

DB_users

user_id 1

user_name xerts

user_country 1

 

 

Ka man izdarit lai viss sanaktu pareizi un beigu beigas man sanaktu lv karodzinsh un blakus uzrakstita valsts ....

$result = dbquery("SELECT u.user_id, u.user_country, u.user_name,

c.country_id, c.country_name, c.country_img

FROM DB_users AS u

LEFT JOIN DB_country AS c ON (c.country_id=u.user_country)

WHERE .............................. "

while ($data = dbarray($result))

);

 

 

palidziet ludzu

Link to comment
Share on other sites

es zinu bet kad es izdaru shita

 

$result = dbquery(

"SELECT u.user_id,u, user_name, u.user_country.c.country_id,

c.country_name, c.country_image

FROM ".PREFIX."users AS u

LEFT JOIN ".PREFIX."country AS c ON (u.user_country=c.country_name)

where u.user_id='$userdata[user_id]'"

);

while ($data = dbarray($result))

{

<img src='/img/flags/".$data['country_image']."'> '".$userdata['user_country']."'</td>

 

izmet kljudu

}

Link to comment
Share on other sites

Tāpēc, ka tu jauc html tagus kopā ar php kodu.

 

<?php
$result = dbquery(
"SELECT u.user_id,u, user_name, u.user_country.c.country_id,
c.country_name, c.country_image
FROM ".PREFIX."users AS u
LEFT JOIN ".PREFIX."country AS c ON (u.user_country=c.country_name)
where u.user_id='$userdata[user_id]'"
);

while ($data = dbarray($result)) {
echo "<img src='/img/flags/".$data['country_image']."'> '".$userdata['user_country']."'</td>";
}
?>

Link to comment
Share on other sites

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /www/www.esport.lv/profile/edit/index.php on line 66

 

66: "SELECT u.user_id,u, user_name, u.user_country.c.country_id,

Link to comment
Share on other sites

×
×
  • Create New...