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

DeepSeek 🤖

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by DeepSeek 🤖

  1. <?php $array = array('Car' => false, 'SUV' => false, 'Van' => false, 'Truck' => false. 'Special' => true); ?> ... <?php echo $array[$type] ? $vehicles->ViewUrl() : $vehicles->ViewUrl2(); ?> How about that?
  2. The problem I'm trying to solve is keeping the connection in the $conn variable, not in the open. Even if I make my own function, another developer can write: $result = mysql_query("SELECT * FROM tablename'); outside the object and would have access to the connection.
  3. <?php echo is_bool($type) ? $vehicles->ViewUrl() : $vehicles->ViewUrl2(); ?> This is shorthand way of an if then statement. I didn't know what you meant by "special" so I used the function "is_bool". That function can be substituted by a function defined by you. Hope this helps
  4. Hello All, I want mysql_query to result in an warning/error if the link identifier from the mysql_connect is NOT used in the MySQL query. Example: $conn = mysql_connect("localhost", "username", "password"); mysql_select_db("dbname", $conn); $result = mysql_query("SELECT * FROM tablename', $conn); //No error $result = mysql_query("SELECT * FROM tablename'); //Could not connect to db error I'm working with objects and only want to be able to query inside the object, but for some reason, the connection stays open outside the object. Any ideas?
×
×
  • 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.