No big deal, mate. Here, let's take a look at the PHP printf() manual page. If you don't know how to reach it, go to, type "php", click on "I'm feeling lucky", and in the resulting page type "printf" in the search box (hint: top right) - complex, but not science rocket. Anyway, looking at the printf manual page, we notice it says

void printf ( string format [, mixed args])

Produces output according to format, which is described in the documentation for sprintf().

Hummm, not much to go on. BUT, upon closer inspection, we may notice a reference to this other function: sprintf. The PHP team is a bunch of nice guys, and they even spare us the effort of typing "sprintf" in the search box: they provide us with a direct link in the very text of the page! Should you miss that, they even provide a duplicate in the "See also" section. Try clicking on either - they take you to the same place, and, behold, the answer to your question is indeed there.

If you had the patience to go through this e-mail (took you MUCH longer to read this than actually do it yourself), then you should also take the time to read this piece: - it'll save you time and ridicule in the future. If you're too busy to go through the whole piece, I would recommend this chapter in particular:


William Martell wrote:
----- Original Message ----- From: "William Martell" <[EMAIL PROTECTED]>
Sent: Friday, December 13, 2002 2:13 PM
Subject: printf %d

Hello All.

Can anyone tell me what this '%d' refers to?

A pointer would be great.  Thanks

if (!$result)
die ("Query Failed\n");
printf ("Number of rows returned: %d\n<br><br>",
<-------------------------HERE '%d'
mysql_num_rows ($result));
while ($query_data = mysql_fetch_array ($result))

 echo "Part#: ".$query_data[holman_part]."<br>";
 echo "Description: ".$query_data[part_desc]."<br><br><br>";

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to