Jump to content

Recommended Posts

I have a list names in a database table in MySQL that I need to repeat the same search for on my system to get the associated information. Is there a Loop command or some type of trick to making a php script search table1.row1 then table1.row2 then table1.row3 etc.

 

Basically using the row in the table as a variable for the other commands in the code.

 

I really need some direction. Thanks.

 

 

 

I have a db called names with two columns, name and link.

i have script that can run a name through a webpage by posting the data but i dont know how to make the script get the name from the db and then enter the corresponding link then go to the name in the next row within mysql.

I have a db called names with two columns, name and link.

i have script that can run a name through a webpage by posting the data but i dont know how to make the script get the name from the db and then enter the corresponding link then go to the name in the next row within mysql.

That still not very clear. You'll need to post an example of what you're trying to do.

So you're looking for something like this? I still don't fully understand the second part of what you're trying to do though.

 

$sql = "SELECT * FROM names";
$result = mysql_query($sql) or trigger_error("SQL", E_USER_ERROR);

$nrlines =  mysql_num_rows($result);

for ($i = 0; $i < $nrlines; $i++)
{
$stats = mysql_fetch_array($result);
$name = $stats['name '];
$link = $stats['link'];

echo $link;
}

Thanks I think I need something similar to that. I am using cURL to POST a form submission. I have a list of names (searches for the form) in mySQL.

 

So I think I need to do something like this within a loop to replace $nlink with each name in my mySQL table.

 

curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name='+$nlink+'&p_name_type=A&p_search_type=BEGINS');

 

 

 

 

 

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.