• Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    @diafol, youve been of great help. Enjoy your time off. @cereal, thanks for taking time to explain. As follows is the updated code: <?php if (isset($_GET['delete']) && trim($_GET['delete']) && isset($_GET['album']) …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    When I dumped the $sql var, I got this error message: Error SQL query: Documentation $sql = "SELECT im_image, im_thumbnail FROM tbl_image WHERE im_id = '$imgId' AND im_album_id = '$albumId' …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    @diafol, I meant that the first select query in the file generates syntax error, when I run the SQL query on PHPMyAdmin. Both queries given below, which I've tried give …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    I'm still not able to fix the issue. Is there a better way to write this select querry? $sql = "SELECT im_image, im_thumbnail FROM tbl_image WHERE im_id = {$_GET['imgId']} AND …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    I changed that statement in line 3 to the following, and the error message stopped, but the file is not deleted: if (isset($_GET['delete']) && trim($_GET['delete']) && isset($_GET['album']) && trim($_GET['album']) && …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    Thanks for your continued support. I'll follow your instruction to see if I can get it to work. And I'll update this post afterwards.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    I echoed the MySQL query and got the following error message: SELECT im_image, im_thumbnail FROM tbl_image WHERE im_id = 1 AND im_album_id = Delete product category failed. You have an …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in Issue deleting data via PHP/MySQL

    @diafol, Thanks for pointing out the potential security flaw. I'm going through that linked article, to close that security hole. Yes, I'm the same person who stated that I had …
  • Member Avatar for mexabet
    mexabet

    Gave Reputation to diafol in Issue deleting data via PHP/MySQL

    SELECT im_image, im_thumbnail FROM tbl_image WHERE im_id = {$_GET['imgId']} AND im_album_id = {$_GET['album']} This is BIG MASSIVE SQL INJECTION waiting to happen. Never, ever, place raw user input into an …
  • Member Avatar for mexabet
    mexabet

    Created Issue deleting data via PHP/MySQL

    I'm experiencing an issue deleting data via PHP/MySQL query. The following is the error message: Delete product category failed. You have an error in your SQL syntax; check the manual …
  • Member Avatar for mexabet
    mexabet

    Began Watching Issue deleting data via PHP/MySQL

    I'm experiencing an issue deleting data via PHP/MySQL query. The following is the error message: Delete product category failed. You have an error in your SQL syntax; check the manual …
  • Member Avatar for mexabet
    mexabet

    Marked Solved Status for I need help with PHP/MySQL modify password issue

    I wrote a modify password file, but unfortunately, the MySQL query is throwing error: Warning: mysql_query() expects at most 2 parameters, 3 given in admin\modify-password.php on line 40 This is …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in I need help with PHP/MySQL modify password issue

    @Cereal, that was beautiful!
  • Member Avatar for mexabet
    mexabet

    Gave Reputation to cereal in I need help with PHP/MySQL modify password issue

    > Warning: mysql_query() expects at most 2 parameters, 3 given in admin\modify-password.php on line 40 It happens because this function does not support prepared statements, and it only accepts two …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in I need help with PHP/MySQL modify password issue

    @Nibble, Thanks for the updated code. The modify password worked, but it throw an error message, after the modification: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in …
  • Member Avatar for mexabet
    mexabet

    Created I need help with PHP/MySQL modify password issue

    I wrote a modify password file, but unfortunately, the MySQL query is throwing error: Warning: mysql_query() expects at most 2 parameters, 3 given in admin\modify-password.php on line 40 This is …
  • Member Avatar for mexabet
    mexabet

    Began Watching I need help with PHP/MySQL modify password issue

    I wrote a modify password file, but unfortunately, the MySQL query is throwing error: Warning: mysql_query() expects at most 2 parameters, 3 given in admin\modify-password.php on line 40 This is …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in I need help inserting data into MySQ database via PHP

    Thanks, I'll go through the snippet to see if I can figure it out.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in I need help inserting data into MySQ database via PHP

    @pritaeas, thanks for your continued support. I took a look at the code snippet you linked to, but was confused by the fact that it mixed connection with the query …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in I need help inserting data into MySQ database via PHP

    @diafol and @pritaeas, a million thanks. Please, what's the MySQLi's equivalent of this code: mysql_query($query) or die ('Sorry, an error occurred while inserting data into the database. ' . mysql_error());
  • Member Avatar for mexabet
    mexabet

    Gave Reputation to diafol in I need help inserting data into MySQ database via PHP

    1. Do not use mysql_* functions they are deprecated - use prepared statements (PDO/mysqli) - see my tute: [DW Tutorial: Common Issues with MySQL and PHP](https://www.daniweb.com/programming/web-development/threads/499320/common-issues-with-mysql-and-php) You seem to be …
  • Member Avatar for mexabet
    mexabet

    Created I need help inserting data into MySQ database via PHP

    I'm getting the following error message, while inserting data into a MySQL database table: Sorry, an error occurred while inserting data into the database. You have an error in your …
  • Member Avatar for mexabet
    mexabet

    Began Watching I need help inserting data into MySQ database via PHP

    I'm getting the following error message, while inserting data into a MySQL database table: Sorry, an error occurred while inserting data into the database. You have an error in your …
  • Member Avatar for mexabet
    mexabet

    Marked Solved Status for Issue with updating image to single user based on id.

    I have a user registration script that includes image upload. Everything works, but each time a user registers, the image he/she uploads replaces the image (userimage) of every other user. …
  • Member Avatar for mexabet
    mexabet

    Marked Solved Status for Issue with updating image to single user based on id.

    I have a user registration script that includes image upload. Everything works, but each time a user registers, the image he/she uploads replaces the image (userimage) of every other user. …
  • Member Avatar for mexabet
    mexabet

    Created Issue with updating image to single user based on id.

    I have a user registration script that includes image upload. Everything works, but each time a user registers, the image he/she uploads replaces the image (userimage) of every other user. …
  • Member Avatar for mexabet
    mexabet

    Marked Solved Status for How do I auto-populate form fields with data in a MySQL table?

    I have some data in a MySQL table, and I want to use them to populate form fields, so the site's admin can edit them. This is what I have …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    I still haven't solved the issue. Can anyone help? The data I want to display as the input values are firstname, lastname, username, usersex, password, email, phone and userimage. These …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    I tried the following code, but the page simply went blank: if ($users = query("SELECT * FROM users WHERE id = '$id'") !== true) { return false; } else { …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    That's very surprising. before I've used that exact same function in another script to auto-populate a form input and edit it. The only difference was that in the previous case, …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    Sorry, I posted MySQL select query, instead of the query function. Here it is and it works well: function query(/* $sql [, ... ] */) { // SQL statement $sql …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    The query: $id = $_GET["id"]; $user = query("SELECT * FROM users WHERE id = '$id'");
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    That prints out: Array ( [id] => 5 ) The printed number (5) corresponds to the exact user's ID I selected.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    I've unsuccessfully tried a couple of things like this: $id = $_GET["id"]; $user = query("SELECT * FROM users WHERE id = '$id'");
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    Honestly, I don't know how to pass a user's ID as a parameter to the query. Can you help, please?
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    @veedeoo, I'm using our company's custom-made appliance installed inside VMWare Player. @pritaeas, Your idea seems to help figure out the problem. Using printf, I noticed that selecting any user's ID …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How to share post from website to facebook or twitter...

    For Facebook share button: [https://developers.facebook.com/docs/plugins/share-button]() For custom Twitter tweet button: [http://www.seotreats.com/04/02/2012/how-to-use-custom-image-for-tweet-button.html]()
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    Sorry, but I'm developing with an appliance, which is installed inside a virtual machine. My best bet would be if I can get help here.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    How do I debug? I haven't done that before.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    I'm aware there's an error, but I don't know how to fix it. Actually, I have another page named "list-users.php. On this page, all the users are properly listed with …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I auto-populate form fields with data in a MySQL table?

    @pritaeas, Thanks for replying. I need the form fields to populate with data from database table named "users". But unfortunately, they're not populated when the page (modify-user.php) loads.
  • Member Avatar for mexabet
    mexabet

    Edited How do I auto-populate form fields with data in a MySQL table?

    I have some data in a MySQL table, and I want to use them to populate form fields, so the site's admin can edit them. This is what I have …
  • Member Avatar for mexabet
    mexabet

    Created How do I auto-populate form fields with data in a MySQL table?

    I have some data in a MySQL table, and I want to use them to populate form fields, so the site's admin can edit them. This is what I have …
  • Member Avatar for mexabet
    mexabet

    Marked Solved Status for How can I insert URL inside an echoed table column?

    I want to insert a URL inside an echoed table row. Here is the URL and table column: <a href="modify-user.php?id=<?php echo $row["id"]; ?>">Modify</a> Here is the table column: printf("<td class=\"listusers\">" …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How can I insert URL inside an echoed table column?

    @thirty.soul, Thanks, but diafol has already given me the answer I was looking for.
  • Member Avatar for mexabet
    mexabet

    Gave Reputation to diafol in How can I insert URL inside an echoed table column?

    printf("<td class='listusers'><a href='modify-user.php?id=%d'>Modify</a></td>",$row['id']); Something like that? Not sure what you're trying to do, nor the context in which you're trying to do this.
  • Member Avatar for mexabet
    mexabet

    Created How can I insert URL inside an echoed table column?

    I want to insert a URL inside an echoed table row. Here is the URL and table column: <a href="modify-user.php?id=<?php echo $row["id"]; ?>">Modify</a> Here is the table column: printf("<td class=\"listusers\">" …
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I merge two insert queries into a database table?

    Thanks for the link. I'm going through the resource to see if I can pull it.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I merge two insert queries into a database table?

    Sorry, but I don't know how to do InnoDb transactions or MySQLi's multi_query. Can you please, guide me on how to achieve InnoDB transactions? I'd appreciate that.
  • Member Avatar for mexabet
    mexabet

    Replied To a Post in How do I merge two insert queries into a database table?

    Thanks for replying. query() is a custom function that executes SQL statement, possibly with parameters, returning an array of all rows in result set or false on (non-fatal) error.

The End.