Make A Horizontal Loop?

how to make a horizontal loop.. i've searched some codes but didn't work this is my sample code:

$movies=mysql_query("SELECT * FROM movies ORDER BY movie_id DESC");
<td><? echo $rows['title'];?></td>

the output is:


the output that i want is: title1 title2 title3 Next>> i'm a newbie in programming that wants to learn


Make Array Object In For Loop With Horizontal View?

$xml = simplexml_load_file('');
$information = $xml->xpath("/xml_api_reply/weather/forecast_information");
$current = $xml->xpath("/xml_api_reply/weather/current_conditions");
$forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");


I want Out somthing like this manner of the horizontal ,

Even i tried UL LI WITH display inline but it goes failed,

View 2 Replies View Related

Horizontal Loop

I'm building a php form that retrieves about 25 categories from a MySQL database and creates a list of check boxes so users can select multiple categories before submitting the form. Right now I'm using the code below and it creates a vertical list of categories with check boxes.

View 6 Replies View Related

Horizontal Loop For Output

What would be the best way to set up a loop to output the results in say counts of 4 followed by a <br> for the following code snippet:

View 2 Replies View Related

Horizontal Loop Problem

I have some data I want to export from a database, where the limit is set for pagination. However, the max per page can be changed by the user.

The following code, sometimes causes errors in the table display and does adds extra fields at the end etc, where there are none required, throwing out all of the able allignment. PHP Code:

View 1 Replies View Related

Horizontal Repeat Loop

I have a recordset which i want to populate a table. I want there to be 3 colums accross and as many rows down as necessary. I can loop down the row, but cant work out how i can loop horizontally only three times then go to the next row and repeat. I guess i have to use an array, Code:

View 5 Replies View Related

How To Make The Horizontal Pdf File

how can i make a harizontal pdf file by using php.i created for the register form(name ,email, street,city country)

View 1 Replies View Related

Make A Horizontal Bar Chart With Data From An Array

I'm trying to make a horizontal bar chart with data from an array

$values = implode(',', array_values($type));
$labels = implode('|', array_keys($type));
$img = "{$values}&chxt=x,y&chtt=Ticket+Types&chxl=1:{$labels}&chts=676767,21.5";
echo "<img src='{$img}' alt='Chart'>";

This isn't giving me what I want to achieve but I'm having a hard to fixing it. The code above gives me a horizontal bar chart with the y labels as the number of row (i.e. the first label is 1, the second label is 2) and incorrect x numbers.

I want the labels up the y axis and the values along the x.

View 2 Replies View Related

Meaning Of Phrase "Try To Make You Architecture More Horizontal Rather Than Vertical" ?

I've just listened to [URL] (Zend webinar about PHP performance). I can't understand what this phrase means "Try to make you architecture more horizontal rather than vertical" (see screenshot)

View 2 Replies View Related

Make Loop

The while loop only shows one result instead of all results. People said i have to use a loop, but i don't know how.

View 1 Replies View Related

Need To Make The For Loop Work

Can any one tell me how to execute the below mentioned for loop. as i am not able to do so and also i have tried with foreach and while statements it seems like the comparison and increament and intialization doesnt work here. $combval is the array variable which has got multiple values. and with the second snippet of the code i am able to load the first value of the array vairable ...

View 1 Replies View Related

Trying To Make A Loop, Cant Figure It Out

im trying to make a little loop, but i cant figure it out... i
have a string with a bunch of 1s and 0s in it: 110101010101111010101
.... i need to count the number of 1s divide it by 2 and make a table
with 2 columns and then for every one, depending on its position in the
string i need to output a word and then go to the next 1 and output a
dif word....

its amenities, winter activities and summer activities for cottages
that i store in my db with 1s and 0s when its a 1 the amenitie or
whatever exists when its a 0 then it doesent exist...

View 3 Replies View Related

Trying To Make A FTP Spider... With Loop

I've been trying to code a FTP spider, to function as a search engine for the FTP servers on our network.

The code writes down all of the files with the ftp server name in front in text files.
It's about to work, just one little problem...

When I want to spider a directory with directories inside of it I have a small problem. The spider only writes down the first dir in the list. However, when there are only files inside of a directory that I want to spider the script writes them down perfectly...

A week or two ago I had gotten this almost working, however because of the end of school and such I had to postpone the coding, now I'm kinda lost in my own code...

$ftp = $_GET["ftp"];
$dir = $_GET["dir"];
$ftp_host = $ftp;
$ftp_user = "anonymous";
$ftp_password = "anonymous";

echo "Connecting to $ftp_host via FTP...<BR>";
$conn = ftp_connect($ftp_host);
$login = ftp_login($conn, $ftp_user, $ftp_password);

$mode = ftp_pasv($conn, TRUE);

if ((!$conn) || (!$login) || (!$mode)) {
   die("FTP connection has failed !");
echo "Login Ok.<BR>";
$mode = ftp_pasv($conn, TRUE);

function itemize_dir($contents) {
   foreach ($contents as $file) {
       if(ereg("([-dl][rwxstST-]+).* ([0-9]*) ([a-zA-Z0-9]+).* ([a-zA-Z0-9]+).* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9])[ ]+(([0-9]{2}:[0-9]{2})|[0-9]{4}) (.+)", $file, $regs)) {
           $type = (int) strpos("-dl", $regs[1]{0});
           $tmp_array['line'] = $regs[0];
           $tmp_array['type'] = $type;
           $tmp_array['rights'] = $regs[1];
           $tmp_array['number'] = $regs[2];
           $tmp_array['user'] = $regs[3];
           $tmp_array['group'] = $regs[4];
           $tmp_array['size'] = $regs[5];
           $tmp_array['date'] = date("m-d",strtotime($regs[6]));
           $tmp_array['time'] = $regs[7];
           $tmp_array['name'] = $regs[9];
       $dir_list[] = $tmp_array;
   //return $tmp_array;
   return $dir_list;

function spider($ftp, $dir, $conn) {
//$conn = $ftp_host;
$buff = ftp_rawlist($conn, $dir);
$items = itemize_dir($buff);
foreach($items as $line=>$item)
$file = $ftp . $dir . $item['name'];  
$fh = fopen('ftp.txt', 'a') or die("can't open file");
fwrite($fh, $file . "");

  echo $file;
  echo "<BR>";
  //echo $item['name'];

if(strpos("/", $ftp, $dir . $item['name']) == TRUE) {
$ydir = "/";

if($item['type'] == 1) {
return $dir . $item['name'] . "/";
  } } }

$work = spider($ftp, '/', $conn );

while($var = 0) {  
if( $work != 0 ){
$works = spider($ftp, $work, $conn );
else {
$var = 1;}

And I do specify the ftp server in the variable: ?ftp=

View 3 Replies View Related

Make For Loop More Efficient?

So I have this for loop with 36 if-queries inside. Any advice on making it more efficient?You can view the complete code here

Here's a sample of what it looks like:

$numbers = range(1, 36);
for ($m =0; $m<37; $m++){
if ($numbers[$m] == "1"){
$mirza[$m] = "RUTHIE";

View 5 Replies View Related

Use Array_sum Or Loop And Make Sum?

Have an array


I want to sum of all key add result should be 6

View 3 Replies View Related

While Loop Make Too Many Arrays?

I needed to block out specific date ranges. I found a code to do this, and it utilizes arrays. I like that.What I then needed was a way to create the array with every date within the range, because I only entered the Start Date and the End Date. Found one. Works like a charm.But nw, I have a problem. It creates a new array using the same $. So the only array that the calender registers is the newest one.

function createDateRangeArray($strDateFrom,$strDateTo) //Changes a Range of Dates to Specific Dates

View 3 Replies View Related

Make A While Loop With A Counter?

i am currently working on a mailing list and its function is to send EVERY single user a notification email once an entry they are looking for on a database is available.below is the mailing_list.php which sets up database connection and deals with the fields of the table:

PHP Code:
global $connect;[code]....

As you can see toward the end of mailing_list.php, in the while loop i echoed out $query, but it only echoed ONE query of that entire array .so wut i am trying to do is to make a while loop with a counter in it, but still only one result shows up.Basically, i want the $query to output all items in an array so that following SELECT statement can choose the item which matches the required query and send the users the notification email bout such particular query.

View 1 Replies View Related

Make A Loop For Formula?

How can I make a loop for this formula?

P (1 + r/365)365

View 13 Replies View Related

Make Rows In A Loop

Im trying to implement the "little pic poll" in my site, but in the source its coded to diplay the images and radio buttons in a table, and the way it renders on the screen is in a straight colomn down, i want to have the picts render in like maybe 4 element wide rows going down, so first fill in the first row, then the second, so on. but as it is now it just has the picts showing each under the other. Im showing all the source code, but its not all pertinant to my question. TY.

include("lp_settings.php"); //include file containing general settings
import_request_variables("p", "p_"); //import POST variables
import_request_variables("c", "c_"); //import cookie variables

if (!isset($c_votingstep)) {
} else { $votingstep = $c_votingstep; }

View 3 Replies View Related

Make A Number From A Loop A Certain Length

Is there a way to make a number from a loop a certain length?

If I have the following numbers:

I want them to show up as:

If I have:

I want them to show up as:

View 9 Replies View Related

Make 3 Columns With Last Class In Loop

I want to make a 3 columns and add last class to third column. I tried this code:

<?php for ($i = 0; $i < 9; $i = $i + 4) { //can't touch this line ?>
<?php for ($j = $i; $j < ($i + 4); $j++) { //can't touch this line ?>


but it doesn't work.

View 3 Replies View Related

Make For Loop Real Time?

I want to Make a Script which give result realtime. In My Script it have 3 steps. 1st step was to grab all links from a webpage .(i use pregmatch_all function coz all links i need are started with same domain [URL]... and grab from [URL]... ) 2nd step i have to grab direct link from all links (like [URL]...) 3rd step Upload that file to and third party site and get the upload link from there . lastly i added a function named which get the page ranges (like '1|5' ) so script upload all links from [URL]... I have done the scipt it was alo running ok but it shows result after all completed but i want a realtime result like script have grabed one link and do all steps with it and show that reult link on browser and then so on i mean a realtime solution. How can i do that i used for loop but no real time result.

View 3 Replies View Related

Make A Loop To Keep Check If Variable Changes?

Below is a code to check a ustream account if they are broadcasting live. What I'm trying to do is make it change live on the site if the variable changes. So if the user goes live, it updates the div tag on the site without having the user refresh. How can I do that?

HTML Code:
<div id="status" class="status"></div></p>
<script type="text/javascript">
function set_status(status)

View 3 Replies View Related

Make Database Updates In A WHILE Loop?

I have a page which retrieves and displays an Audit schedule from a database. But one field in the database, 'days_til_due' I want to update dynamically, whenever the page is accessed, and  THEN display the updated database value on the page.  Basically: (Days 'til due = (Today's Date - Date Last Done) + Frequency)Everything else works okay, but 'days_til_due' in the database isn't updating.  For error checking, I'm displaying the php calculated value of $daystildue first, and then next to it the database version of this value $row['days_til_due'].  These 2 columns should be identical

Code: [Select]$q = "SELECT auditUI, audit, clause, name, DATE_FORMAT(lastaudited, '%M %d, %Y') AS la, frequency, days_til_due FROM schedule ORDER BY audit, clause ASC";
$r = mysqli_query($dbc, $q);

View 5 Replies View Related

Make A Script Break Out Of Loop If Not Responding

I have a script that scrapes content from a number of partner sites, this works fine but I have a problem if one of the site's does not respond or if it take a very long time to respond.

This long response time causes to entire script to time out but what I want it to do it just move onto the next site after 5seconds.

What is the best ay to do this, it it possible to use set_time_limit() or will this cause the entine script to time out. Any help would be appreciated.

View 1 Replies View Related

Best Way To Loop Through Data To Make Nested Lists ?

I'm trying to turn some db data into a nested list structure to use as menus

first off, i fgured that it would be quicker to make one sql query, put the results in an array and then loop through that rather than making millions of queries - is this assumption correct ?

basically i have all my product families in a table - each family has a parent id (p_id) which is the fam_id of the family it belongs to, and its own family id (fam_id) and name (fam_nom) Code:

View 3 Replies View Related

Make The Loop And Variable Variables Into A Function?

How can I make the code below into a function?# split the string by string on boundaries formed by the string delimiter will split the value into an array like the example below,

# Array
# (
# [0] => pg_cat_id=1
# [1] => tmp_id=4
# [2] => parent_id=2

View 4 Replies View Related

Make The Code Witn One Loop And One Variable?

Anybody can do the following code with one loop and one variable?

$result = Array();
for (
$x = 0; $x < 6; $x++)

View 6 Replies View Related

Counter - Make The Number 1 Add 1 To Itself And Repeat In The Loop

i am trying to do is make the number 1 add 1 to itself and repeat in the loop so, 1 2, 3, 4, 5, 6 ect...What am i doing wrong.

$result = mysql_query("SELECT * FROM comments WHERE quoteid = ".$_REQUEST['quoteid'].""); 
$date = $row[date];
$name = $row[name];
$email = $row[email];
$quoteid = $row[quoteid];
$comment = stripslashes($row[comment]);
$commentid = $row[commentid];

View 2 Replies View Related

Make Closed Loop Which Run The Function In Unlimited Way?

let say we have (function) and that function has one variable which is (id)the (id) could be number any number 1 or 4 or even 49999 to make closed loop which i mean run this function in unlimited wayeach time with new id <--- i can do it by set random()but the problem i've is how to make it repeat itself


View 3 Replies View Related

Preg_match - Make A Loop That Reads All The Files In A Folder

I know basically what I have to do to achieve what I want, but preg_match is so confusing with its search criteria and characters. I want to make a loop that reads all the files in a folder (they are all images) and sort them by their initial filename and the number included. Each folder will have something like this:


I want to sort it something like "original[0-9].jpg" and either put it in array or whatever so I can count the total (like 3 of each) and use each one. I have the right loop I think for the files, but I don't know how to do the filename filter.

View 8 Replies View Related

Copyrights 2005-15, All rights reserved