Give User Mysql Delete Privilege For One Query Via Is This Possible?
What i'm basically looking to do is give a user delete privileges for one query only. This is just so i can keep my database clean. Am i best just writing a DB logon script for that one query only and allowing that user to delete the records or is there a way PHP can grant delete for one query?
View Complete Forum Thread with Replies
Related Forum Messages:
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ? $query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error()); im just getting "Unknown table 'notes' in MULTI DELETE" ?
View Replies !
Mysql Query : Delete From *
When I use phpmyadmin, and run this sql query, it will tell me that it affected X amount of rows (lets say 10). However, when i run my script, it doesnt' tell me that. Code:
View Replies !
Give User Different Site
I'm trying to set up a staging environment on my website where clients can see the progress on their web(site/page). I was wondering if there was a way using php and/or other common apache modules to change the document root of a subdomain based on login data, collected either by HTTP authentication or just by an HTML form... Without editing apache2.conf or any other server-wide configuration file. So for instance, joe visits stage.mydomain.com and is presented with a login request. once he logs in, stage.mydomain.com serves him the files contained in /web_designs/joes_site. But when jane logs in she is served the documents in /web_designs/janes_site while accessing the same url.
View Replies !
How To Give Personal User Url On A Dating Website Just Like MySpace Does?
I had posted a question regarding how to design high traffic fast dating website on different PHP groups. I got a lot of useful responses. I have added links to all the posts below for reference. I am back with another question regarding the dating website. How do I go about creating personal user url on the site like it is done on MySpace.com The personal url for user1 will look like www.myWebSite.com/user1 The first solution I know is to create a folder for each user and put a index.php script that show the user profile. But then there would be a lot of folders. how can I catch the user1 from the url request string www.myWebSite.com/user1 The ssecond solution would be to set the page not found script in Apache. But then again I need to capture the 'user1' from the request string. Discussion 1- http://groups.google.com/group/Prof...96e1b11a08c5cf2 Discussion 2- http://groups.google.com/group/php....5b3b100d70a196e Discussion 3- http://groups.google.com/group/PHP-...5531288b538882e Discussion 4- http://groups.google.com/group/mysq...8cff7c40c161889 Discussion 5- http://groups.google.com/group/OOP-...ba2c6e36c3bc006 Discussion 6- http://groups.google.com/group/PHP-...6c403cec4bc14e8 Discussion 7- http://groups.google.com/group/comp...712f83d1cdb278d Discussion 8- http://groups.google.com/group/alt....14bf3f43c74f633
View Replies !
Give User A Choice Of Fields To Search With Full Text/Boolean?
I want to give the user the option of searching a combination of the fields $Topic, $Subtopic, $Theswords in Boolean/Full Text. The problem is if I make any of the fields empty prior to the query, I get a MySql syntax error message. The user has the option of selecting fields via checkboxes, but when the field is not selected the user will get the error message because the variable is empty in the query statemtnt. Are there any code suggestions for avoiding the error message when a field is not selected by the user to be searched? Code:
View Replies !
Delete Query - Error In Your SQL Syntax; Check The Manual That Corresponds To Your MySQL Server
I have tried to make a delete query but it won't work it gives me a syntax error but I'm unsure where i have gone wrong.... this is what i have got at the moment: Quote$Deletesoldhouses = "DELETE * FROM soldhouses WHERE SoldHouseID = '$HouseID'"; mysql_query($Deletesoldhouses) or die(mysql_error()); Can any one see what i did wrong? Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM soldhouses WHERE SoldHouseID = '1'' at line 1
View Replies !
MySQL Doesn't Give Me Number
I have in a table stats of which one field is marked either 1 or 0. I want my script to show how many times that number is 1... At first I did it with PHP checking the value like this: Code:
View Replies !
Php/MySQL Login - Can Anyone Give Me Suggestion As To Why Thiscode Does Not Work ?
I have followed the step by step instructions in the login manual Created login page Use LSC01 This works - login and get redirected to the proper page My problem is the cookie variables don¹t show up (created setsessions.php page and readsessions.php to test - works) On the page, I¹ve applied LSC03 * Access by Cookie * this seems to work since it allows my to enter the page I want I then applied the LSC05 * User Details - The correct rsUserDetails is set up I then include Dynamic Text to the page that is suppose to show the registered users information but it doesn¹t Have torn page apart 50 million times I know it¹s one line or something extremely simple but I can¹t figure it out. Code for login page <?php require_once('../../Connections/reg.php'); ?> <?php // Buzz inet PHPLSC01 - Login & Set Cookie $myUsername_rsLogin = "0"; if (isset($HTTP_POST_VARS['email'])) { $myUsername_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['email'] : addslashes($HTTP_POST_VARS['email']); } $myPassword_rsLogin = "0"; if (isset($HTTP_POST_VARS['password'])) { $myPassword_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['password'] : addslashes($HTTP_POST_VARS['password']); } mysql_select_db($database_reg, $reg); // Verify Login is correct $query_rsLogin = sprintf("SELECT email, password FROM parent WHERE email= '%s' AND password = '%s'", $myUsername_rsLogin,$myPassword_rsLogin); $rsLogin = mysql_query($query_rsLogin, $reg) or die(mysql_error()); $row_rsLogin = mysql_fetch_assoc($rsLogin); $totalRows_rsLogin = mysql_num_rows($rsLogin);....
View Replies !
Privilege System
I am working on an application that needs to have the ability to have group/user privileges. These privileges need to go down to the script level. For instance, there are 15 reports and I need to be able to grant a user access to 3 of the 15. Additionally, there is an edit form and certain users should only be able to edit the social security number for agents.
View Replies !
Group Based Privilege Systems
Trying to figure out the best way to implement a user/group system using PHP and MySQL, and I was wondering if any of you have any thoughts on the subject. Each webpage I design will have a corresponding entry in a module database table and they will be verified using PHP_SELF. For instance. When you visit index.php, there will be a function that queries a database against PHP_SELF and looks for index.php to find out if it has any special group privileges (if they can edit something or just view it etc) if there are no group privileges then it will be assumed that everyone can do everything on that particular webpage. The users groups that he is a member of, will be held in sessions when the user logs on. What do you think? is this a common way of doing it? is it secure?
View Replies !
Field Level Access Privilege
Is there an easy way of assigning access privilege to a database field? If I want some users to be able to see some fields and not others, what is the best way of designing it?
View Replies !
Delete Uploaded File When User Exits
I've been working for this simple project. User fills out the application form (uploads a file), redirected to the confirmation page, make a payment, redirected to the payment confirmation page and then it sends an email with this file to the customer or admin. There is no user authentication so it could be anybody uploading files. The problems is that I want to delete the uploaded file when the user exits the browser or click onto some other page when the user decides to withdraw from making a payment. Because this temporary file becomes permenant. Of course you can delete the files manually using ftp but it could be a hassle for the end user. I've been thinking about session_set_save_handler, register_shutdown_function or connection aborted functions but none seems to work in this situation.
View Replies !
Delete Database Base On User Choice
i want to let user delete their data from database. Note: one user may have more than one rows of data. table as following; TCid UserName Topic Content 1 q1 aa aa 2 q2 aa aa 3 q3 aa aa 4 q1 aa aa 5 q2 aa aa And i code as following steps; 1) ask user input user name 2) Display out all the data which the users got. (it is in delete.php file.) in here, i will use the check box, to let the user choices which data they will delete. note: i will try to make the Cid relate with the input name, so later on i can delete the data base on Cid. 3) i will delete the data base on the user choice(it is in deleteR.php file). but at the movement, i just want to test where i can get the value of the TCid or not (because i will delete some datas base on the TCid which the user choiced). The problem i go now, it is from the step 3, i could not get the TCid's value out, that's mean, i could not delete some data base on the user choiced. Code:
View Replies !
Script That Allows The User To Delete Images On The Server.
I have a script that allows the user to delete images on the server. The delete script has the server username and password in it as part of the code. This makes me nervous because if someone were to read this script, they would have access to the server and all the files Now on the server, I have .htaccess set to prevent directory browsing in the directory where the file is stored and the file the script is on is also password protected.
View Replies !
Delete Query
Here’s what I’m trying to do: - Output the last 60 results in my db - works - Delete a record – does not work Can anyone see why my delete query won’t work? It seems to have two problems: 1) It does not delete a record 2) The header re-direct says can’t modify header information Code:
View Replies !
Delete Query Successful
How can I test whether a delete query on any other query for that matter has been successful deleting a record. I tried below but it does'nt return if the query deleted a record. $deletequery= "DELETE FROM details WHERE id='$line[id]' AND orderid='$orderid' AND location='".LOCATION."'"; mysql_query($deletequery) or die(ErrorDB($realname)) ; $message = (!$deletequery) ? 'ERROR' : "<font color='#FF0000'>DONE</font>"; echo "$message<br>";
View Replies !
Simple Delete Query
This code should delete a row from the database where ID = ID however it doesn't seem to be doing its job PHP Code: <? if(isset($_GET['id'])) { Â Â Â Â Â Â Â Â $query = "DELETE FROM mynews WHERE id = '" . $_GET['id'] . "'"; Â Â Â Â mysql_query($query); Â Â Â Â echo "<p align='center'>Deleted</p>"; Â Â Â Â } else { Â Â Â Â Â echo "<p align='center'>Not Deleted</p>"; } ?>
View Replies !
Delete Query Not Working As Expected
I have 2 different php forms. One makes sure that a user has chosen an unique user name (below): $query_rsApp = "SELECT * FROM users where UserName=".$Registered." "; This Select query works right every time (as far as I can tell). I have a form that I want to use to delete user records. This Delete query works fine if the username and password are both numeric... But if the username or password is text, it returns the error "UNKNOWN FIELD 'whatever'" where whatever is my search criteria that I am trying to use.
View Replies !
Delete Query Takes HOURS
why on EARTH would this query: Code: DELETE FROM `test_zip_assoc` WHERE id > 100000 take an entire day when there are 10 million records in this database: Code: +--------------+------------------+------+-----+---------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+------------------+------+-----+---------------+----------------+ | id | int(12) unsigned | | PRI | NULL | auto_increment | | f_id | int(12) unsigned | | | 0 | | | zip | varchar(5) | | | | | | lat_radians | decimal(12,11) | | MUL | 0.00000000000 | | | long_radians | decimal(12,11) | | MUL | 0.00000000000 | | +--------------+------------------+------+-----+---------------+----------------+
View Replies !
User Is Verified By A MySQL Database, And Then A Session: 'user' Is Registered.
I have a problem with sessions. In my code admin.php the user is verified by a MySQL database, and then a session: 'user' is registered. Well when the user presses a link to a another page called news.php it will be checked if the session is the same as in the same script, or if it's even registered (to prevent people trying to break in). But everytime i redirect to news.php I get a file included ip.php wich tells me Im about to break in. Code:
View Replies !
Mysql DELETE
im a stuck again, could some one please tell me why this dosent work; mysql_query("DELETE FROM messages WHERE from='$fromid', sento='$myid'");
View Replies !
Delete For MySQL
I'm an experienced java/C++/SQL programmer who hasnt used PHP. I'm looking for some generic database access pages for doing dds, edits, deletes, etc., hopefully with some error handling. I'd rather start with a basic shell of code, so I don't have to reinvent the wheel, and can just change connection string, database fields, etc.
View Replies !
Delete MySql Row By Date
Can someone help me with the following problem: I have a table that includes a column for "last application date", let's simply call it "date". Now the problem is how to automatically delete rows where the information in the "date" column has gone old, let's say by -86400 (1 day). Example: today's date is April 11th, which means that all rows with the info April 10th in the date column would get deleted.
View Replies !
How Do You Do A CASCADE Delete In MySQL?
I'd like to delete a record and all its children records at one time. How do I do that? Can you, in one SQL statement, delete from table 1 where id = 3 delete from table 2 where id = 12 delete from table 3 where id = 12 ......
View Replies !
MySQL - Delete Across Two Tables. OT
i cant find the MySQL newsgroup, however i am hoping to pick up on some expert advice from php/mysql gurus here. I'm having some trouble performing a delete across two tables. The tables i have are: questionnaires (id, name); questionnaire_questions (questionnaires_id, id, name, qf_type) The questionnaire_questions table contains a list of questions for a specific questionnaire (indicated by the questonnaires_id). I would like to remove a questionnaire, and when doing so all corresponding questionnaire_questions who have matching id's (questionnaires.id = questionnaire_questions.questionnaires_id). I have this statement, however it only works if a questionnaire has questions... however i would like it to delete even if no questions exist for that specific questionnaire. The SQL i am using is: delete questionnaires, questionnaire_questions FROM questionnaires, questionnaire_questions WHERE questionnaires.id = questionnaire_questions.questionnaires_id AND questionnaires.id = THE_QUESTIONAIRE_TO_DELETE_ID
View Replies !
DELETE Problem With MySQL
I've been learning using PHP and MySQL from the tutorial at freewebmasterhelp.com. Everything works fine, except deleting things. The script is invoked with a URL like this: http://www.example.org/test/delete_entry.php?id=35 And here's the script: <? include("dbinfo.inc.php"); $id = $_POST['id']; mysql_connect($server, $user, $password); $query = "DELETE FROM test1 WHERE id = '$id'"; @mysql_select_db($database) or die("Unable to select database."); mysql_query($query); mysql_close(); header("Location: entries.php"); ?> The dbinfo.inc.php file defines the variables $server, $database, $user and $password. The login part works.
View Replies !
Mysql Delete From A Form
i'm trying to find out how to get this to work. You type in a name of a record in the database and it removes it. In this case it's deleting the record that when you type in the name of the server it looks for it in the column "servername". You type in the servername and it will delete the whole record. Code:
View Replies !
MySQL MultiTable Delete...
I've been able to delete rows from one table successfully but what I want to try next is giving me some problems. I have a users 'id' which is unique. Heres what I want to-do. DELETE * FROM users WHERE id = 1 DELETE * FROM messages WHERE from = 1 DELETE * FROM comments WHERE user = 1 In each table there oginizaed a little different hense the id , from & user... but thats what I want to-do, without having to-do them all sepreatly, would like it to be efficent. the users ID will be passed along as the var 'id' any thoughts? So pretty much it takes the users id number and deletes them from each table.
View Replies !
Mysql Delete Record
when I run this code below it doesn't delete the record or display any error message $id = $_GET['id']; include("../dbconnect.php"); mysql_query("DELETE FROM promotions WHERE id='$id'") or die(mysql_error()); Such a simple thing to do but I don't no why it doesn't work
View Replies !
How To Delete Only Certain Text In A Mysql Row?
I have a table setup that has a column setup as friends and users can add friends to this column no problem. What I would like to know is how to delete only certain parts of the text of the row/cell where their friends are stored. The friends text is seperated by the following : " , " That is a space on either side and comma in the middle of the space. I know how to explode the results and put into an array to display the reuslts, but is there a way to delete only one of the friends if the text is as follows. , thomas , frank , irene , I think you can get the idea. Is it possible to do this or should I just update the whole cell without the array[$i] result being the friend?
View Replies !
PHP Unlink() & Mysql Delete
Im trying to delete a file, then delete the row in my table that holds the info for this file. I tried the code below and got this error: Parse error: parse error, unexpected T_STRING in /nfs/cust/4/97/13/731794/web/Admin/backup/PXS_DeleteBackup.php on line 34 Here is my code:
View Replies !
Mysql Row And File Delete
I have a database with the following colums, imageID, imageName, imageDesc, imageFile, imageHeight, imageWidth, imageThumb, imageThumbHeight, and imageThumb Width. I can easily delete a row from the mysql table, galImages, but I also want to delete two files from a directory. The file names are stored in the columns imageFile and imageThumb.
View Replies !
Delete MySQL Data
I am building a lunch ordering system for a company. The employees can login, order lunch, and the administrator can see what everyone ordered for lunch in the admin panel. The problem is that when the employees enter data, it stays in the database until they update it. If an employee is sick, their lunch order from the previous day is still in the database. Is there a way to clear those values they enter at a certain time in MySQL.
View Replies !
Delete Duplicates In MySQL
I have a database in MySql which has 2 fields. The 1st field is called id which is the primary key. The 2nd field is called full_add where there are some duplicates. I would like to delete all the duplicates in the full_add field leaving only 1 record behind. It does not matter if the corresponding primary key gets deleted as well because the primary key is not related to any other table or database. I prefer not to use temporary tables or create new tables because my webhost does not allocate much memory to me & my database is quite big.
View Replies !
How To Delete MySQL Database.
I've got three hostings with the GoDaddy hosting service. The hostings are supposed to provide only one MySQL database each. I've just recently noticed in the phpMyAdmin program that separate databases, each with the name "test," has appeared in two of the three hostings. I don't know how they got there. I didn't put them there. I contacted GoDaddy's technical support. They said that the "test" databases automatically comes with the phpMyAdmin program. Of course, that's not right. Anyway they said that I could delete the extra database without damaging anything.
View Replies !
MYSQL/PHP Delete Script
Im having problems getting my delete script to work it comes back with: Delete Error: Unknown column 'EVANS' in 'where clause' so it is using the surname i input as the column name but why?
View Replies !
|