3

i was trying to convert text into image with php. Now i've finished it but the script is still getting the image data manually here is the query code :

    $host = "localhost";
$user = "root";
$pass = "root";
$db   = "rc";

$connect=mysql_connect($host,$user,$pass) or die ("failed to connect") ;
$connect_db= mysql_select_db($db,$connect);

$grab = mysql_query('SELECT * FROM wp_woocommerce_order_itemmeta WHERE meta_id="4980"');
$d = mysql_fetch_array($grab);
$meta = $d["meta_value"];

in this script i use('SELECT * FROM wp_woocommerce_order_itemmeta WHERE meta_id="4980"') which manually get the meta_id from database and if i want to convert another text to image i should change themeta_id="4980" to another meta_id my question is how do i get the latestmeta_idautomatically from database ? any help will be very appreciated

1 Answers1

1

Use Query

SELECT * FROM wp_woocommerce_order_itemmeta order by meta_id desc limit 1
Ankur Tiwari
  • 2,762
  • 2
  • 23
  • 40