2 Posts Hello everyone! I'm (trying) to deliver your content to the tastes of the day by displaying a résumé of each item (contained in a database) on the index. I discovered recently substr that seems to stick to what I'm looking only voila, I can not! Here is my code: <! - BDD Connection -> <? Php require "config.php"; mysql_connect ($ address, $ name, $ password); mysql_select_db ($ database); ?> <! - On Rcuperation info -> <? Php $ sql = "SELECT FROM Article cat1 ORDER BY time DESC LIMIT 0,4!";? $ Q = mysql_query ($ sql) or die ('Error SQL <br />'. $ Sql. '<br />' insert .mysql_error ()) ;; $ Article = $ data ['Article']; ?> <! - Display items -> <? Php while ($ data = mysql_fetch_assoc ($ q)) {echo substr ($ Section 0.1)!?; }?> Rsultat: Notice: Undefined variable: data in C: \ wamp \ www \ Test \ index2.php on line 12 So I guess the wrong data variable, but as beginner, I can not find error .. So I come to you esprant know that illuminate my lantern. Thank you in advance!
Posts 114 Hi, Ta variable $ data out of nowhere. We must initialize dj, then your code is wrong: <! - On Rcuperation info -> <? Php $ sql = "SELECT insert FROM Article cat1 ORDER BY time DESC LIMIT 0,4" ; $ Q = mysql_query ($ sql) or die ($ sql '<br />' .mysql_error () 'Error SQL <br />!'..); while ($ data = mysql_fetch_assoc ($ req)) {$ article = $ data ['Article']; echo substr ($ Section 0.1); } I need regular.>
4671 Posts At the same time MySQL LEFT command does the same thing ... SELECT LEFT (Article 1) FROM cat1 ORDER BY time DESC LIMIT 0,4 http://dev.mysql.com/doc/ refman / 5.0 / en / string-functions.html insert # function_left Altered by jb_gfx (September 19, 2011 - 21:30)
Go Home gnrales Questions and Semantic Web beginners question and HTML, XHTML, HTML5 Mobile Web responsive web design and formatting CSS, CSS3, JavaScript, DOM and HTML5 API Web Accessibility Web Formats , encoding, internationalization, XML ct Web Development Server Reviews of your sites: Bar code and design forum
Alsacréations is a community dedicated to designing websites and web applications quality, insert thanks to the W3C standards, CSS stylesheets, HTML and JavaScript, and accessibility
No comments:
Post a Comment