Jump to content
php.lv forumi

MySQL select


jancuks2

Recommended Posts

Man sanāk izvadīt datus.

 

<?php
$result1 = mysql_query("SELECT website FROM extras WHERE id='{$_GET['id']}'");
while($rows = mysql_fetch_array($result1)) {
	echo 'Mājaslapa: '.$rows['website'].''; 

}
?>

 

Un man vaig lai izvada vārdu "Nav" ja website rindā nav nekas ierakstīts.

Link to comment
Share on other sites

Vari provēt šādi :)

<?php
$result1 = myslq_query("SELECT $website FROM extras WHERE id='$id'");
?>

 

 

kas tas pa samuģījumu :D

 

$website vietaa uzrakstu abrakadabra un lauka nosaukuma manaa tabulaa nava :D

 

neizskataas peec automaatiksas kļūdas?

 

ps: jo $website tak mainiigais lielums.. bet tabulaa lauki tak ir konstanti..

Edited by sheps
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...