son Posted September 12, 2008 Share Posted September 12, 2008 What means the regular expression '%d'? I know 'd' means any single digit, but I canno find info on '%'....Son Link to comment Share on other sites More sharing options...
boen_robot Posted September 12, 2008 Share Posted September 12, 2008 Where exactly did you see that? Are you sure it's not something like PHP's sprintf() function? I can't find a reference on that either. Link to comment Share on other sites More sharing options...
son Posted September 12, 2008 Author Share Posted September 12, 2008 Where exactly did you see that? Are you sure it's not something like PHP's sprintf() function? I can't find a reference on that either.I find it in several places on new website I am working on. It is in queries as:SELECT first_name, last_name FROM users WHERE user_id=%dSon Link to comment Share on other sites More sharing options...
Lulzim Posted September 12, 2008 Share Posted September 12, 2008 that's exactly what boen_robot said, it is from sprintf and it is used on sql queries a lothere is an example from php.net $query = sprintf("SELECT firstname, lastname, address, age FROM friends WHERE firstname='%s' AND lastname='%s'", $firstname, $lastname); %d is for a decimal number that will come as a second argument on sprintfread more @ php.net Link to comment Share on other sites More sharing options...
son Posted September 15, 2008 Author Share Posted September 15, 2008 that's exactly what boen_robot said, it is from sprintf and it is used on sql queries a lothere is an example from php.net$query = sprintf("SELECT firstname, lastname, address, age FROM friends WHERE firstname='%s' AND lastname='%s'", $firstname, $lastname); %d is for a decimal number that will come as a second argument on sprintfread more @ php.net Got it! Thanks a lot...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.