Advertisement
3_2004-2005 String Manipulation #148460

sub select for mySQL

how to do subselects in mySQL

AI

AIサマリー: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ソースコード
original-source
$query = "CREATE TABLE tmp
	 SELECT my_id	 
     FROM table1
     WHERE myvalue is null
	 ";
mysql_query ($query);
$query = "SELECT sec_id, info
	 FROM table2
	 LEFT JOIN tmp 
	 ON sec_id = my_id
	 WHERE sec_id NOT IN(my_id)
	 ";
				 
$result=mysql_query ($query);		 
mysql_query ("DROP TABLE tmp");
		
while ($row = mysql_fetch_array ($result)) {
echo $row["sec_id"]."\n";
echo $row["info"]."\n";
}	
<WebMethod()> Public Function YourIPAddress() As String
    Dim sCallersIPAddress As String = Context.Request.UserHostAddress
    Dim sReply As String
    sReply = "<<- This is either your PC's IP, or the proxy you use."
    Return (sCallersIPAddress & sReply)
  End Function
  <WebMethod()> Public Function LocalFunction(ByVal YourName As String) As String
    Dim sCallersIPAddress As String = Context.Request.UserHostAddress
    Dim sReply As String
    If sCallersIPAddress <> "127.0.0.1" Then
      ' A webservice request from an external PC
      sReply = "Hey, " & YourName & ", IP " & sCallersIPAddress & " may not execute this function!"
    Else
      ' Do something different for calls from localhost
      sReply = "Hello, " & YourName & ", IP " & sCallersIPAddress & " this app is runnning from " & Context.Request.PhysicalApplicationPath
    End If
    Return (sReply)
  End Function
オリジナルのコメント (3)
Wayback Machineから復元