Function: JScms_row_exist
avatar
Señor FAQ

¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.


Function: JScms_row_exist

The JScms_row_exist function checks whether a row exists in the specified table by its ID.

Syntax


JScms_row_exist($jakdb, $id, $table)
    

Parameters

  • $jakdb: (object) An instance of the database connection using JAKWEB\JAKsql.
  • $id: (int|string) The ID of the row to check.
  • $table: (string) The name of the database table to query.

Returns

(bool) Returns true if a row with the given ID exists in the table, or false otherwise.

Example Usage


<?php
// Check if a user exists by ID
if (JScms_row_exist($jakdb, 123, 'users')) {
    echo "User exists.";
} else {
    echo "User does not exist.";
}
?>
    
Was this article helpful?
0 out of 0 found this helpful