Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6691847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:47:58+00:00 2026-05-26T05:47:58+00:00

I need help to convert the following Visual Basic statement into a PHP equivalent:

  • 0

I need help to convert the following Visual Basic statement into a PHP equivalent:

If Not IsNumeric(siteid) Then

    dr = GetDataReader("SELECT siteid FROM nwsite WITH (NOLOCK) WHERE mac_address = '" & siteid & "'")

    If Not dr.HasRows Then

      Response.Write(sep & siteid & "=" & siteid)

      sep = ","

    End If

    If Not dr Is Nothing Then

      dr.Close()

    End If

  End If

I need help with the If statements more than anything.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:47:59+00:00Added an answer on May 26, 2026 at 5:47 am

    See here for the docs you need to check, also here

    Seems like you also need to learn how to use mySQL in PHP

    The code is relatively easy, in its simplest step- almost line for line from what you have to help you see the transformation to PHP (there are better implementations):

    $siteid = 1; // where 1 is the value of siteid, PHP vars are prefixed with '$'
    
    
    // you also could do 
    //  if(!isset($siteid){
    //  if(!$siteid){
    
    if(!is_numeric($siteid){
      // there is no site ID, so get it from the DB
    
      // Make a MySQL Connection
      mysql_connect("localhost", "user", "password") or die(mysql_error());
      mysql_select_db("dbname") or die(mysql_error());
    
      // Run your query
      $result = mysql_query("SELECT siteid FROM nwsite WITH (NOLOCK) WHERE mac_address = ".$siteid) 
      or die(mysql_error());  
    
      if(mysql_num_rows($result)>0){
        // rows returned
        //assuming only one row is returned, with your siteid value
        $row = mysql_fetch_array( $result );
        $siteid=$row['siteid'];    
      }else{
        // no rows returned
        // do something
      }
    
    }else{
     // $siteid is already a valid value
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help figuring out why the following scenario does not work. I'm
I need help from some one to convert the following line of code from
Is there any way to convert following SQL statement into LINQ? select ve.EntityID ,
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
i need help with disk_total_space function.. i have this on my code <?php $sql=select
Need to convert the following code from Ruby to C#. However I'm kind of
I need to convert a QChar to a wchar_t I've tried the following: #include
I need to convert the following correlated subquery in Linq to Sql. I am
I have the following problem: i need to convert a decimal number to string.
i have a string.i need to convert it to Voice. can any one help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.