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

  • Home
  • SEARCH
  • 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 7418169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:50:10+00:00 2026-05-29T07:50:10+00:00

im a new guy in php i want help ,i google a lot about

  • 0

im a new guy in php i want help ,i google a lot about it but couldn’t figure it out. I want to write ips of sites from the table url into a database in a row known as ips.

I use gethostbyname to get IP, now what I want to do is get ip of that site stored in url row and store that IP in ips row of the table but I’m nt able to do it: only the first row’s URL IP is written in all of the ips columns. Please tell me how to write each URL’s IP in the ips column of the corresponding row.

<? 
   include"cfg/db.php"; 

   $mirror_al = 
   mysql_query("SELECT * FROM kayitlar"); 
   $mirror = mysql_fetch_array($mirror_al); 
   $siteip=$mirror['url']; 
   $shrt=substr($siteip, 7); 
   $url = rtrim($shrt,"/"); 
   $mystring = $url; 
   $parts = explode("/",$mystring); 
   $mystring = $parts['0']; 
   $fullip=gethostbyname($mystring); 
   echo $fullip; 
   $ekle2 = mysql_query("UPDATE kayitlar set ips='$fullip'"); ?>
  • 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-29T07:50:11+00:00Added an answer on May 29, 2026 at 7:50 am

    i’m not sure why you GET id if you don’t use it anywhere… i’ve added siteid from database – please see if it works:

    include"cfg/db.php"; 
    $id = $_GET['id']; 
    
    $mirror_al = mysql_query("SELECT * FROM kayitlar"); 
    
    while($mirror = mysql_fetch_array($mirror_al))
      {
        $siteip =$mirror['url']; 
        $siteid = $mirror['id']; // please correct accordingly
    
        $shrt=substr($siteip, 7); 
        $url = rtrim($shrt,"/"); 
        $mystring = $url; 
        $parts = explode("/",$mystring); 
        $mystring = $parts['0']; 
        $fullip=gethostbyname($mystring); 
        echo $fullip; 
    
        $ekle2 = mysql_query("UPDATE kayitlar set ips='$fullip' where id='".$siteid."'"); 
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a new guy in PHP OOP concepts. One of the first things that
new guy here and I'm slowly getting the hang of python, but I have
I'm new to PHP and this question seems stupid. But I'm really confused with
Hi I'm calling out for help from all the PHP Gods on Stackoverflow :)
So I am an old web forms guy and new to the MVC (in
I have never developed for WAMP, the hosting guy for my new client says
New to both Ruby and Rails but I'm book educated by now (which apparently
New to WCF, but familiar with COM+ - can I wrap a WCF service
I have read many article about this one. I want to hear from you.
our office just got this new guy with lots of experience and kept insisting

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.