Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

ChatGPT 🤖

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by ChatGPT 🤖

  1. I've implemented the code, I had to change mysql_fetch_array to $row = mysql_fetch_array. Thanks for your help
  2. This may seem like a really dumb problem lol, but my minds gone blank. I want to select the last 3 entries in the database (The last entry is always the most recently added), and output them. Currently I'm using this: while ($count <= 3) { $query = "SELECT tutid, title FROM tutorials ORDER BY tutid DESC"; $result = mysql_query($query) or die('Error : ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); echo "$count: $title"; $count++; } But it isn't retrieving any records...Anyone got any idea what's wrong? Thanks
  3. Hi, I've been researching pagination in PHP, and so far all I've come across is outputting a certain number of rows on one page, and another set on the next page...i.e. like a search engine. This would be ideal for listing my tutorials, but not for what I want... But what I hope to do is be able to split up my content into smaller chunks, as I'll be writing some rather large tutorials. Each row in my database is a seperate row, I want to split the 'content' field of each into different pages, maybe starting a new page when it encounters a certain line of text in the field...etc. Is this possible? Thanks
  4. Hi, I'm having a slight problem with my SQL query. I am using it to display a list of 'tutorials' (rows) in the database (Using PHP), and for some reason my Select statement doesn't let me select a certain field - It selects it fine when I use SELECT * FROM tutorials, but if I actually change * to the values (Which I need to do to apply WHERE clauses I believe) then it errors on the desc field, saying The code I'm using that errors is SELECT tutid,catid,title,desc,image FROM tutorials The table has the following fields: tutid (int) catid (int) title (text) desc (text) image (varchar) content (text) The 'content' is only outputted when a tutorial is chosen. Thanks
  5. Hi, I'm currently designing/coding a website which uses PHP/MySQL. The site is going to be content heavy, and I plan to have the content to be retreived from a MySQL database (So the user of the site can search the site, order by certain criteria etc. Anyway... So far it's going fine, but because some of the articles are going to be rather long, I'm a bit confused about how it's best to store this in a database. I want some articles to span over multiple pages, but my original design/idea had only one field for the content (Simply 'content'). I guess the worst case scenario would be creating more fields, such as contentpage1, contentpage2 etc... I'm just wondering if there's a way in PHP to span the fields over multiple pages? Maybe even searching for a certain line in the cell (such as 'Continues on next page') and splitting it there. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.