Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8582391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:16:46+00:00 2026-06-11T21:16:46+00:00

this is how i am attempting to use it: <?php $post_title_edited=$post1 . vs .

  • 0

this is how i am attempting to use it:

<?php
$post_title_edited=$post1 . "vs" . $post2;

$con2=mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name2")or die("cannot select DB");


// Create table
$create = 'CREATE TABLE  '. $post_title_edited .' 
(
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
  user VARCHAR(30) NOT NULL, 
  user_post VARCHAR(2000) NOT NULL, 
  date VARCHAR(30) NOT NULL
)';



// Execute query
mysql_query($create,$con2);

echo $post_title_edited;



$query='SELECT LAST(id) as LastId FROM '.$post_title_edited.'';
$last=mysql_query($query);

echo $last;
?>

post1 and post2 are user inputs. the table is created and the first echo works. the second one does not. i suppose this may be a mad place to test this code as the table is empty, put i have tested it on a similar table with 5 entries and have gotten the same result,nothing. from the little i have been able to scoop up on google, im using it correctly. i even resorted to using bing on this one just in case google missed something. i cant seem to find a solid explanation of how to use this. thanks in advance.

regardless of the code, i would really just like an explanation of how last() or first() works, i’ve seen bits of other ways to find the first or last value of an sql column. but again those were explained rather poorly

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:16:48+00:00Added an answer on June 11, 2026 at 9:16 pm

    Why not ORDER and LIMIT:

    $query='SELECT id as LastId FROM '.$post_title_edited.' ORDER BY LastId DESC LIMIT 1';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to use code I've found that uses Win32. However, I'm getting this
I am attempting to use livequery. I unfortunately am stuck using jquery 1.2.6. This
I am attempting to compress a string via use of zlib (I've tried this
I'm attempting to use the PHP DateTime class on a Solaris server with PHP
I'm attempting to use multiple ANDs in this query below, and it messes up
I am attempting to use PHP to edit the DOM document tree. However, I
I am attempting to use PHP 5.2's SoapServer functionality. I setup soapserv.php as shown
I am attempting to use the following PHP class: <?php class Service { public
hey i'm attempting to pass xml values using this hidden form: <form method='post' action='addholiday.php'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.