Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As others have noted jQuery can not access the database, also from the code you have posted it seems that you are aware of that since you access the db with php and only use jquery to fade in fade out data.</p> <p>So what you have done so far is ok but you need to hide all data echoed by php and let jquery parse the data and only display/fade in the rows you need. Then fade out the last shown data and fade in the next rows you want to display. This way you create a cycle of the latest news.</p> <p>Judging from your query i assume you are using joomla so i propose another solution which works well and saves you from the server side trouble. Create an article (or item if you use cck like k2 etc) or module that holds the latest news. If it is an article assign that to a menu item that is not visilbe to your site, but published (this is a common technique with joomla to create nice urls of content or simply have access to data as in your case). If it is a module add it to the page you desire (it is the page where the jquery code is executed) but assign a class name to it in order to hide this module via css i.e. using <code>display:none</code>.</p> <p>This will save you from maintaining the server side code, which already has some issues as far as i can see i.e. you should not use prefixes in joomla queries to db, you should use the joomla way of accessing the db etc.</p> <p>Also this way you can manage the content from your cms i.e. show only latest news, or news from a specific category etc without writing any server side code and without having to modify your sql query.</p> <p>Finally you write jquery code that screen scrapes/parses the contents of that article or module and appends the data to any div you like with any effect you require i.e. fade in , fade out etc.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload