zenag
-
Posts
443 -
Joined
-
Last visited
Posts posted by zenag
-
-
open and close braces for if statement
if (string.length !=6) { return false; } return true;
-
(SELECT * FROM table1) UNION (SELECT * FROM table2) ORDER by date desc
-
left join must have space
SELECT name_details.name,name_details.node,ip_details.ip FROM name_details left join ip_details on ip_details.name=name_details.name
-
SELECT name_details.name,name_details.node,ip_details.ip FROM name_details leftjoin ip_details on ip_details.name=name_details.name
-
SELECT * FROM table1, table2 ORDER by date desc
-
$_SERVER['REQUEST_URI']
-
<? $con=mysql_connect("localhost","root",""); mysql_select_db("login",$con); $j=0; for($i=0;$i<=4;$i++) { $z= $j+2; //echo "select * from user limit($j,$z)"; $sql=mysql_query("select * from user limit $j,$z"); while($row=mysql_fetch_array($sql)) { ?><table><tr><td>heading1</td></tr><tr><td> <? if($z==2){ echo $row["nickname"];}?></td></tr></table> <table><tr><td>heading2</td></tr><tr><td> <? if($z==4){ echo $row["nickname"];}?></td></tr></table> <table><tr><td> <? if($z==2){ echo $row["nickname"];}?></td></tr></table> <? } $j=$j+2; }; ?>
-
sorry i cant get u...whether the query displays some error
-
u have not gvn open bracket before..INSERT
$new = ("INSERT INTO travek_user_cols(1,2,3,4,5,6) VALUES('".$result["online"]."','".$result["online"]."','".$result["online"]."','".$result["online"]."','".$result["online"]."','".$result["online"]."'");
-
$server = "79.170.40.51:3306";
-
$server = "localhost:3306"; // this is the server address and port $username = "web15-ian"; // change this to your username $password = "1234567 "; $link = @mysql_connect ($server, $username, $password) or die (mysql_error());
-
use mysql_fetch_array() after.. $result = $db->query($sql);
-
CAN U SHOW CODE?
-
return $result["online"];
-
OUT FOR LUNCH BE BACK AT 2.PM
-
while ($row1=mysql_fetch_row($result2)){ $uuid=$row1[0]; echo $uuid; } [quote] i ve assigned this value...echo $uuid; [/quote] #$result3 = mysql_query("SELECT users.firstname,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id = NULL) $result3 = mysql_query("SELECT users.firstname,incidents.description,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id < '$uuid') AND (incidents.owner_id = 0)",$link);
refer this.... this query might help u ...check this query ..it will output results from users table where owner_id in incidents table is null... SELECT users.firstname,incidents.description,users.surname,incidents.owner_id FROM users LEFT OUTER JOIN incidents ON incidents.owner_id = users.id WHERE incidents.owner_id IS NULL
-
sorry pal....ur query works fine ..ur correct...set in ur database for owner_id field as default value as NULL OR 0 in mysql...it will work fine..
$result3 = mysql_query("SELECT users.firstname,incidents.description,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id < '$uuid') OR (incidents.owner_id = NULL)",$link);
-
yeah...just noew i ve came to my seat.....right now hve seen ur mail.....i wl check it out...
-
query hasnt yet accepted .." incidents.owner_id=NULL "..its not working ,we cannot display fields from two tables by satisfying condition from single table (ie.incidents.owner_id satisfies only incidents table but not users).if the condition satisfies both tables only we can able to display fields from both tables..
-
query hasnt yet accepted .." incidents.owner_id=NULL "..its not working ,we cannot display fields from two tables by satisfying condition from single table (ie.incidents.owner_id satisfies only incidents table but not users).if the condition satisfies both tables only we can able to display fields from both tables..
-
since u have selected only four fields here..
$result3 = mysql_query("SELECT users.firstname,incidents.description,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id < '$uuid') OR (incidents.owner_id = NULL)",$link);
it would display that selected fields only....if u need to select all fields from two tables u can write it as...
SELECT * FROM incidents,users where ...
-
ive changed these lines... $myusername = "administrator"; echo $myusername; for my convenience .... change it to $myusername = $_SESSION['myusername']; echo $myusername;
-
this solves all ur probs.....
<? session_start(); $clicked=$_POST["gender"]; ?><? if($clicked=="open") { ?> <html> <title> Welcome to Project Management Tool</title> <body bgcolor=#AFC7C7> <h1> Report</h1> <?php $myusername = "administrator"; echo $myusername; //put the above right at the top of your script. Everything else can follow ?> <? //header("Content-Type: text/plain"); /* set's the variables for MySQL connection */ $server = "localhost"; // this is the server address and port $username = "root"; // change this to your username $password = ""; // change this to your password /* Connects to the MySQL server */ $link = @mysql_connect ($server, $username, $password) or die (mysql_error()); /* Defines the Active Database for the Connection */ if (!@mysql_select_db("helpcore", $link)) { echo "<p>There has been an error. This is the error message:</p>"; echo "<p><strong>" . mysql_error() . "</strong></p>"; echo "Please Contact Your Systems Administrator with the details"; } $sql1 = mysql_query("SELECT id from users where loginname ='".$myusername."'",$link); while($row=mysql_fetch_row($sql1 )) { #echo $result[0]; $uid=$row[0]; echo $uid; #$uid=$result["id"]; #echo "$uid"; } #$result2 = mysql_query("SELECT incidents.id, incidents.description, users.firstname, users.surname, users.loginname FROM incidents,users WHERE (incidents.owner_id = users.id) AND (incidents.contact_id = '".$result[0]."')", $link); $result2 = mysql_query("SELECT id, description FROM incidents where contact_id = '".$uid."'", $link); #echo ("SELECT incidents.id, incidents.description, users.firstname, users.surname, users.loginname FROM incidents,users WHERE (incidents.owner_id = users.id) OR (incidents.contact_id = '".$uid."')"; //echo $result2 ; #$result2 = mysql_query("SELECT incidents.id,incidents.description,users.firstname,users.surname,users.loginname from incidents,users where (incidents.owner_id = users.id) OR (incidents.contact_id = '".$uid."')", $link); while ($row1=mysql_fetch_row($result2)){ $uuid=$row1[0]; echo $uuid; } #$result3 = mysql_query("SELECT users.firstname,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id = NULL) $result3 = mysql_query("SELECT users.firstname,incidents.description,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id < '$uuid') OR (incidents.owner_id = NULL)",$link); //echo "SELECT users.firstname,users.surname,incidents.owner_id FROM incidents,users where (incidents.owner_id = users.id) OR (incidents.owner_id < '$uuid') OR (incidents.owner_id = NULL)"; if (!$result3) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } /* Starts the table and creates headings */ ?> <table border="1"> <tr> <td><strong>ID</strong></td> <td><strong>Description</strong></td> <td><strong>Owner Name</strong></td> <td><strong>Notes</strong></td> <? /* Retrieves the rows from the query result set and puts them into a HTML table row */ /* Retrieves the rows from the query result set and puts them into a HTML table row */ #echo "hello"; #echo "$myusername"; while ($row2 = mysql_fetch_array($result3)) { echo "\n"; echo("<tr>\n<td>" . $row2["owner_id"] . "</td>"); echo("<td>" . $row2["description"] . "</td>"); echo("<td>" . $row2["firstname"] . $row1["surname"]. "</td>"); echo("<td>" . $row2["loginname"] . "</td></tr>"); # echo("<td>" . $row["name"] . "</td>"); # echo("<td>" . $row["create_time"] . "</td>"); } /* Closes the table */ ?> </table> <? /* Closes Connection to the MySQL server */ /* Closes Connection to the MySQL server */ mysql_close ($link); } else { if($clicked=="closed") { echo "closed"; } } ?>
-
it cause of loop problem....some braces have to be checked or can u send full code
[SOLVED] Validate Phone Number Length
in Javascript Help
Posted
script to validate 10 digit number