Error In Query: SELECT Uid, Uperms From Users WHERE Uname =
I am trying to set up the article from the main page in devshed called money is time
the thing is this, it denies access for this user and pass even though they are in the database 'example' and on table (users)
Error in query: SELECT uid, uperms from users WHERE uname = 'john' AND upass = PASSWORD('john'). Access denied for user: '@localhost' to database 'example' Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Multiple Select From Listbox And Execute A Sql Query Select Statement
Supposing i have a html form with 2 listbox and i name it status and resolution. So it goes <select name='status[]'>... <select name='resolution[]'> Then i have a another php page. $status = $_POST['status']; $resolution = $_POST['resolution']; Now my question is, how do i do the sql query statement? mysql_query("SELECT * from bugs where status=$status and resolution=$resolution"); The problem is, i select 3 options form the status listbox eg. new, closed, duplicate. And from the resolution, i chose fixed, invalid.
How To Select Users Within A Range Of Age's
In my database i have the date of birth of my members stored in 3 fields, 'year' 'month' ' day'. I'm using the following code throughout my site, to calculate the age of a given user at any point and echo it onto the page. Code:
Password Protected Directory - Grabbing Uname
I am hoping it is possible to 'grab' the username from when a user enters their username and password to enter a directory ie say I sign in with joe as the username i want the page in that directory to keep a record that joe logged in and did whatever he did on the page (ie approve delete or ban items - i konw the mysql code for this so i just need to know how to get the username [because i think coding a login - which i also dont know how to do would be harder - although that would be good for users later on so this is really a temporary measure])
Query That Logs Onto The Datbase & Retrieves A Users Email Address
I'm trying to create a query that logs onto the datbase & retrieves a users email address and then displays it. Here's the code; <? print "Your email adddress is " ; $conn = db_connect(); $result = $conn->query("select email from user where email='$email'");?> I've had the following response :Catchable fatal error: Object of class mysqli_result could not be converted to string.
Validating Users Error
I am trying to make a script that allows me to validate and figure out if there session has timed out, all using timestamps. I think this piece of code is whats causing the problem. Could anyone with fresh eyes tell me if there are any errors?
Mysql Query - Select Any
I have the following sql statemant to search a mysql database that gets if values from a form with combo box's in. SELECT * FROM hottubs, manufacturers WHERE manufacturers.manid = hottubs.manid AND hottubs.type = '%s' AND hottubs.dimlength <= '%s' AND hottubs.dimwidth <= '%s' AND hottubs.dimhight <= '%s' AND hottubs.seatsto <= '%s' AND hottubs.shape = '%s' ORDER BY $thesearchtype_search. Everything works fine except I want to add a select "any" from the shape combo box. I really need a way of cutting out the last " AND hottubs.shape = '%s' " if the $_GET['shape'] = 'any' Will this work using a variable as shown below?? IF ($_GET['shape'] != 'any' ) { $shape = AND hottubs.shape = '%s' } SELECT * FROM hottubs, manufacturers WHERE manufacturers.manid = hottubs.manid AND hottubs.type = '%s' AND hottubs.dimlength <= '%s' AND hottubs.dimwidth <= '%s' AND hottubs.dimhight <= '%s' AND hottubs.seatsto <= '%s' $shape ORDER BY $thesearchtype_search I have only been doing php about a month so go gentle!
Select Query Problem
I use php4 and winxp. This query works as expected: $result = mysql_query(" SELECT feventid, UNIX_TIMESTAMP(fdate) as fdate, ftitle, fpostedby, fdetails, factive, UNIX_TIMESTAMP(fpostdate) as fpostdate FROM events WHERE fdate between '$datefrom' and '$dateto' and factive and fpostdate <= curdate() ORDER BY fdate, fpostdate "); However, when I add the condition !(strpos(fdetails,'$fsearchstring')===false), $result is false. $result = mysql_query(" SELECT feventid, UNIX_TIMESTAMP(fdate) as fdate, ftitle, fpostedby, fdetails, factive, UNIX_TIMESTAMP(fpostdate) as fpostdate FROM events WHERE fdate between '$datefrom' and '$dateto' and factive and fpostdate <= curdate() and !(strpos(fdetails,'$fsearchstring')===false) ORDER BY fdate, fpostdate "); Even simpler stuff like: 'and strpos('abc','c')>0' does not work. I made two more discoveries trying to crack the problem. Ɔ=0', is an acceptable condition, while 'true' is not. For the first query, $result does not return true, but 'Resource id #3'. I have just started with php. What am I doing wrong?
Select Query For Keywords
I am connecting to an Access database. I have the following code that breaks the user submitted title into an array. I want to match only records that have only the array values, but can be in any order. For example: User enters - "Purple People Eater" Matching Records - "Purple Eater People", "Eater People Purple",... but NOT - "The Purple People Eater", "Purple People",... Here is my code: PHP Code:
Select Query / Loop
My users are organised in a table named 'users'. Each user is a member of a department, but some users are members of more than one department, so I have another table named 'user_department'. I have another table named 'submissions' int which users submissions are stored. Right now I am developing an archive of submissions. Generally speaking a simple query will do the job like this: $query = "SELECT * FROM submissions WHERE status != 'Pending' AND sid = '$username' ORDER BY id desc LIMIT $from, $max_results"; $result = mysql_query($query); The problem comes when I try to select only the submissions lodged by the users department. The point being that the department head can view all submissions lodged by his department. If the department head is only head of a single department, this would work: $query = "SELECT * FROM submissions WHERE status != 'Pending' AND department = '$users_department' ORDER BY id desc LIMIT $from, $max_results"; $result = mysql_query($query); But if the department head is head of more than one department, I start to get lost! I can loop through the 'user_department' table to find out which departments the user is the head of like this: Code:
Php Query To Select Min Date
im trying to get a minimum date from my database, the current way im doing it is: SELECT * FROM events where Date > NOW() OR Date = '9999-12-12' ORDER BY Date ASC LIMIT 1 this works in terms of code, but it doesnt do what I want it to do. Its the ORDER BY Date, that is the problem: What I want to select is The next date OR a date = 9999-12-12 I tried searching for a query like "select MIN date" but couldnt find anything on it, plus the date has to be in the future, hence the need for DATE > NOW() quite confusing I know!! but any advice?
Multiple SELECT COUNT()'s In One Query?
I'm creating a script that, fairly often throughout, I need to use a SELECT COUNT() query on two seperate tables - this seems to be slowing the script down quite a bit, and if the script remains this slow, it won't be of much use to me...which would be very bad! Is there anyway to combine these two to grab the COUNT() value from both in one query?
Pass Array Into Select Query ?
I was wondering if it is possible to pass a php array into a mysql query rather than looping through each one eg: //the array $namesArray = array("Joe", "Jane", "Bob", "Mary", "Paul", "Eddie", "John"); //the sql SELECT id FROM users WHERE name='$namesArray'
Arrays, Query Results And Select Box
I want/need to pre-select a drop-down box with a value if it's present in both a lookup table and user account table. After wrestling with this for a few hours I give up. i know this can't be this complicated, but apparently i'm missing something, so if anyone can suggest a way to go about this i'd be a little more sane. The idea is to have the user value already selected then when they change the value i'll update their account.
Query Select Dates More Than One Hour
i'm searching for the mysql query which can gave me frome DATE_TIME mysql variable which lines are more than an hour i can do that with days with SELECT * FROM clients WHERE TO_DAYS(NOW())-TO_DAYS(date)>7
How To Corret This Mysql Select Query?
I convert some code from access to mysql. And I have a InboxMessage table which has From and To field. So, the query is like: select * from InboxMessage where To=12 12 is user id. This query works fine in access. But does not work in Mysql. I think the problem is the field To, which must be a keyword in mysql. So, how to fix this? I don't want to change the field, becuase this will need to change a lot of code.
Merging 2 Tables With A Select Query?
I have two tables in my database. One is called 'hotfood', the other is 'coldfood'. What I want to do is have a single SELECT query for both of these tables. This is so I can then use 'mysql_num_rows' on this query, like so. if(mysql_num_rows($id)==0) { print "Food type does not exsist"; } else { -- } It basicaly to do a search type thing, the above checks that the food name exists by checking both the hot and cold food table, therefore I need to two merged into the select query so that I can search it.
Error Performing Query: You Have An Error In Your SQL Syntax Near
I have a query which pulls user info from a database table, and displays it in an HTML table. The user then has the ability to edit this data on the next page by clicking continue, where the first and last name are passed as variables, and are listed as uneditable, whereas all the other fields are able to be edited through a simple form. Here's my problem, on the final page where the actual database UPDATE occurs, I'm getting a SQL error that looks like this --------- Error performing query: You have an error in your SQL syntax near 'WHERE first_name='Joe' AND last_name='Schmoe' SET street_address_1='real address' at line 1 ---------- It looks like its passing the first and last name fine (through hidden inputs), yet when I start to pass the edited fields as variables, it cuts off for some reason. The actual full value that I entered for "street_address_1" was "real address 333". It looks like it cut off after the "address", and didnt even bother to send the other 8 fields. My code on the processing page looks like this ---------- $street_address_1_update=$_POST['street_address_1_update']; $street_address_2_update=$_POST['street_address_2_update']; $city_update=$_POST['city_update']; $sql ="UPDATE mailing_list WHERE first_name='$first_name_update' AND last_name='$last_name_update' SET street_address_1='$street_address_1_update' street_address_2='$street_address_2_update' city='$city_update'" ---------- I only included 3 fields for brevity's sake. The rest pass the same way as these three. Again, the first and last names are simply passed as hidden inputs through the form. Anybody have any clue what might be causing this? I know the error is a SQL one, but I may not be passing the variables correctly in PHP.
Very Slow MySQL SELECT Query After 11 Records
I have a very weird problem I moved my database to new IIS 6.0 + PHP 4.3 + MySQL 4.0 setup. I tried to check with myphpadmin if everything works fine, but I couldn't browse my table (125 records). I used SELECT option and found out that SELECT query up to 11 records is ok, but after that, even if I choose to limit query to 12 records, it just hangs. I tried selecting from the beginning of the table and from the middle - same thing, but when I run query localy on mysql console, everything works fine
Select Query With WHERE Clause Doesn't Work Any Longer
I have a table in MYSQL that I'm trying to set up a search query on (so it can be searched for records by an author's name). I did it several weeks ago and then it worked, but now when I try to run the search it returns no records although I know they are there. To my knowledge nothing has changed in my PHP script. I checked everyhting repeatedly but must be blind to the error. It's driving my crazy since I know it worked fine at one time. If anyone has the energy to take a look and offer their suggestions, it would be greatly appreciated. Here is my script. PS. I can add a record and view all the records through other scripts with no problem. <?php # Script 11.6 - md_seaauthor.php // This page searches titles by author. // Set the page title and include the HTML header. $page_title = 'Search Mother Daughter Bookclub by Author' include_once ('header4.html'); require_once ('Connections/mysql_connect.php'); // Connect to the database. $query = "SELECT * FROM mdbookclub WHERE author ='$author'"; $result = mysql_query ($query); while ($row = mysql_fetch_array($result)) { $md = $row['md_id']; $title = stripslashes($row['title']); $author = stripslashes($row['author']); $f_author = stripslashes($row['f_author']); $pub_year = stripslashes($row['pub_year']); $call_number = ($row['call_number']); $display_block .= "<p><strong>Author:</strong> $author <strong>Title:</strong> $title<br /> <strong>Publication year:</strong> $pub_year <br /> <strong>Call number:</strong> $call_number </p>"; } ?>
Using Record Identifier From Select In Update Query?
Just wondering if I can get a record identifier from a query. The basic idea is to process the data in a user-specified field in a user-specified table.. and write it back without modifying any other field. So the program would go something like this: $qid=mysql_query("SELECT $field FROM $table"); WHILE ($list($field_value)=mysql_fetch_row($qid)) { new_field = process($field_value); and then the tricky part - how do I write back $field to $table? If I use an update query (eg: UPDATE $table SET $field=$new_field WHERE $field='$field_value') it will update all the fields where $field is $field_value. Is there a way of getting a (unique) record identifier from the select query and using it in the update query? Since the table is user-specified, I have no way of knowing what the primary index is.
SQL Query With SELECT DISTINCT And LEFT JOIN
I'm having problems with a SELECT DISTINCT statement with an INNER JOIN. Here is the table structure for my tables: 'locked_accounts' locked_account_id uid 'la_comments' comment_id locked_case_id uid status 'user' uid username And here is my SQL: SELECT DISTINCT l.locked_case_id as locked_case_id, l.uid, u.uid as uid, u.username as username FROM la_comments l LEFT JOIN users u ON l.uid = u.uid where status = 1 What I'm trying to accomplish is getting a display of updated accounts (where status=1) and I want to display their username. In the la_comments table, there might be 50 distinct 'uid's, but I only want to display the distinct uid/username's where the status = 1. Can someone point me in the right direction on this. I've messed with this for a couple of hours and I'm at wits end. Not very bright I am when JOIN statements it comes to.
Paginating Random Select Query Results
I am just starting with PHP/MySQL and using Dreamweaver MX 2004. I am selecting a subset of records from a table, then ordering them using RAND() and then displaying 6 at a time on a page. So far so good but there is one major problem, namely, when you move from page to page viewing the results the query is rerun for each page which means that you end up duplicating results. What I want to be able to do is run the query once and then page through the returned results without duplication. Also to be able to go back & forth between pages and see the same set of results. Here's a simplified example: Suppose I have 12 records (call them A - L). The query : SELECT * FROM Table WHERE Criteria = 1 ORDER BY RAND() Which returns: D F K A L F J H G C B I So my pages should show the following: Page 1: D F K A L F Page 2: J H G C B I And I should be able to switch back and forth between these pages and always see exactly the same records each time. However what I see at the moment is: Page 1: D F K A L F Page 2: F B C A E D (Note duplicates from Page 1 because query has been re-run) Page 1: C B F A K L (Note duplicates again plus results not the same as previous visit to Page 1)
Drop Down Menu Where The Items Are From A MySQL Select Query
I am just starting programming in PHP and wonder if it is possible to have a drop down menu where the items are from a MySQL select query. I am registering people for a weekend seminar and want to have a list of valid weekends to choose from on the form. Any pointers to scripts or PHP references that will help would be appreciated. I am using the book "Build your Own Database Driven Website Using PHP & MySQL" to get me started, but also need recommendations for a general primer to php.
Select Count Query, 2 Tables With Identical Structures
I have 2 Tables that have the exact same structures, One is for Inventory, the other is for Relief Inventory (ie. when an item is sold it is moved to relief). What i want to be able to do is to run a query that will count the number of items tested by one person and display that sorted and grouped by the date cleared. I can get this to work when working with just the Inventory table, but the problem is that as items are moved out to relief the counts will change. $query = "SELECT COUNT( * ) AS `Count` , `Date Cleared` , `Tested By` FROM `Inventory` WHERE `Tested By` = ".'"'.$tester.'"'." GROUP BY `Date Cleared` ORDER BY `Date Cleared` DESC "; My question is, how do i run a similar query that will search both tables and combine the results. I have tried adding the other database to the FROM statement, and have been tring to figure out if i can use a join statement but that hasn't yielded any favorable results.
Error In Select Statement
I have the following SELECT statement which aims to select data from the database for a month ago today however im getting an error message as shown below. SELECT STATEMENT $dbQuery="SELECT * FROM data WHERE ReportedDate BETWEEN date("Y-m-d", strtotime("-12months")) AND date("Y-m-d", strtotime("-11 months"))"; ERROR MESSAGE: Parse error: parse error, unexpected T_STRING
Phpgem Error In Select Count ?
I use phpgem to generate forms. it works fine, just one problem with count, I get error messages like this (from the php-script - NOT when i query mysql directly!): SQL query: SELECT COUNT(*) FROM hupoterm WHERE (LOWER(gruppe) LIKE '%e%') Warning: count not found in MySQL result index 2 in sql.php3 on line 255 Could this mean a problem with my table syntax? since 6 days i changed almost all config-parameters in the script, in the table ..... but the error message is still there .
Error In Generating Table From Database Select Statment
I am trying to dynamically create a table with the results from a select statement. Below is the code that is not working. Any help would be oh so greatly appreciated. This is for a final at school which is due in an hour. This is the only thing I can't seem to make work. Code:
Query Error.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ironmanx/public_html/main.php on line 96 That is the error i get with thequery's i am making.
Query Error
I get an error when trying to insert a new row: query error- 5 - Duplicate entry ྌ.200.213.102 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; MyIE2; .NET CLR 1.0.' for key 1 The table consist of timestamp, file, level, ip, naam , ID Where ID is an autoincrement, unique key.
HELP: PHP Search Query SQL Error
I'm trying to run the following search query: $query = sprintf ("SELECT itemNumber, thumbnailURL, title, description, price FROM apparel,hats WHERE apparel.title OR apparel.description OR hats.title OR hats.description LIKE '%s'", $_POST['tfSearch']); but it returns this error: "Column: 'itemNumber' in field list is ambiguous" Both "apparel" and "hats" tables share the same columns specified in the SELECT clause. What I'm I missing?
Error Performing Query:
I currently am making a portal which follows this basic follow: 1. loads db connection info from config.php 2. uses index.php to determine Theme of site, site owner ID, and other data. (This works well and provides all data including meu options, graphics, etc.. from a mysql database). 3. proceed to login screen, which when submitted checks login for valid id this is where the problem occurs.. in the index and header i use one variable called $dbcnx2 to connecto to the master server hoding the theme, site id, etc.. and it all works.. but the first time I try to select a db from the client's site it give me the error that "Clients" does not exist, but its trying to find it on $dbcnx2 instead of $dbcnx1. heres the code for the login check script: Code:
Parse Error When Executing A DB Query
I am attempting to display the results of a MySql db table to a browser. Its obviously very simple, but I keep getting a parse error on this line... echo("<p>" . $row["QuoteText"] . "</p>"); PHP Code:
Parse Error In Nested Query - Please Help.
I am having troubles finding the parse error in this script. I've been checking for weeks. I am too new to the subject I guess. I am trying to show a readord and them have a form at the bottom of the page for inputting data to Update the record. I get a parse error that points to the last line in the script so I know it is something I am missing earlier in the script but doing a line by line it seems fine to me. ------------------------------ <--cut-- $query = "SELECT sub_id, username, story_title, DATE_FORMAT(date_submitted, '%m/%d/%y'), category, story FROM Submission WHERE date_processed < 1 LIMIT 0,1"; $result = @mysql_query ($query); // Run the query. if ($result) { // If OK, display the record. echo '<table align="center" cellspacing="5" cellpadding="1" border="0" width="500"><span><tr><td align="left" width="100">Story ID:</td><td align="left" width="100">Name</td><td align="left" width="250">Title</td><td align="left" width="100">Date Submitted</td><td align="left" width="50">Category</td></tr><tr><td colspan="5"></span><hr></td></tr>' // Fetch and print the record. while ($row = mysql_fetch_array($result, MYSQL_NUM)) { echo"<tr><td align="left" width="100">" ..$row[0] .."</td><td align="left" width="100">" ..$row[1] .."</td> <td align="left"width="250">" ..$row[2] .."</td><td align="left" width="50">" ..$row[3] .."</td><td align="left" width="50">" ..$row[4] .."</td></tr><tr><td colspan="5"width="500"><br>" ..nl2br($row[5]) .."</td></tr> "; } echo '</table>' echo '<hr>'
Query Oci_parse() Apache Error
I get this error, apparently because of my Query: Apache.exe has encountered a problem and needs to close. We are sorry for the inconvenience. the error in on oci_parse() , but when I replace the above query with for example "select * from clients"; I don't get the error. Though I need to use query I put in variable $query.... All my other variables are ok, and the query works when I use it in SQL worksheet for instance. (I use oracle 9i, php5, apche 1.3) what can I do with that query to make it work? $req_id = $_GET['request_id']; print "request id : $req_id <br>"; $req_name = $_POST['request_name']; print "request_name -> $req_name <br>"; $req_date = $_POST['request_date']; print "request_date -> $req_date <br>"; $req_client_id = $_POST['request_client_name']; print "request_client_name -> $req_client_id <br>"; $req_req_type_id = $_POST['request_type']; print "request_type -> $req_req_type_id <br>"; $req_brand_id = $_POST['request_brand_name']; if ($req_brand_id=='Brand Name') $req_brand_id='NULL'
Fatal Error Line 49 -- SQL Query.
Alright I got my Pagination to work on my page. But when I try to narrow my rows down to a certain parameter rather than pulling all rows, i get. These are the lines with the errors. You can statements work, and which ones dont. The statements that pull all rows works and I dont get an error. Code:
Parse Error In Update Query
This is the first time I have ever used the update query. I am not having any luck figuring it out. Please post if you find my mistake, Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [bleeped] on line 46 here is the location of the problem: $sql = "UPDATE $table SET pagecontent = $_POST['T'] WHERE id = $_POST['id2']";
Why Does The Word "Array" Show On A Select Query
I am new to php and MySQL and I'm attempting to run a select query on a MySQL database which is working fine except prior to displaying the table with the results from the select query it displays 1 line for each row in the database containing only the word Array. This is then followed by the correct results in the constructed table. I am not storing the string "Array" in my table. Following is the PHP code for constructing the table from the results variable. for ($i = 0; $i < mysql_num_rows($result); $i++) { echo "<tr>"; echo $row = mysql_fetch_row($result); for ($j = 0; $j < mysql_num_fields($result); $j++) { echo("<td>" . $row[$j] . "</td>"); } echo "</tr>"; } I hope this is enough of the PHP script to solve the problem
Warning: PostgreSQL Query Failed: ERROR: Pg_atoi:
I've built a postgres database that can be controlled through browser inputs to update, insert or delete records. i'm using php to access the db and display results in html. all of my update commands work fine but my inserts will not, each time i try to insert it kicks out this line: Warning: PostgreSQL query failed: ERROR: pg_atoi: error in "head": can't parse "head" in ....... on line 47 for this example "head" is an attribute of type text which is all set up properly to send and hold the correct attribute type ($tag_method in the sql under here). Line 47 refers to the sql command in my php which looks like this: LINE 46: $sql="INSERT into sheep values ('$tag_method', $flock_id, '$sex', '$breed' , $age, $parent_id, '$born_on_farm', '$date_joined', $price_paid, $price_sold, $sheep_number)"; LINE 47: $result_set = pg_Exec ($conn, $sql);
ERROR 2013: Lost Connection To MySQL Server During Query
I periodically recieve the following error from my MySQL server. "ERROR 2013: Lost connection to MySQL server during query" The server load is always very low (0.06). I can't figure out why I am getting these errors. Here is an extened status report from MySQL. +--------------------------+------------+ | Variable_name | Value | +--------------------------+------------+ | Aborted_clients | 5 | | Aborted_connects | 340 | | Created_tmp_tables | 2 | | Delayed_insert_threads | 0 | | Delayed_writes | 0 | | Delayed_errors | 0 | | Flush_commands | 1 | | Handler_delete | 25306 | | Handler_read_first | 23 | | Handler_read_key | 60061392 | | Handler_read_next | 40329034 | | Handler_read_rnd | 3588071416 | | Handler_update | 33411189 | | Handler_write | 433799 | | Key_blocks_used | 7822 | | Key_read_requests | 485870614 | | Key_reads | 5508 | | Key_write_requests | 536763 | | Key_writes | 103759 | | Max_used_connections | 152 | | Not_flushed_key_blocks | 0 | | Not_flushed_delayed_rows | 0 | | Open_tables | 125 | | Open_files | 84 | | Open_streams | 0 | | Opened_tables | 287 | | Questions | 76301760 | | Running_threads | 87 | | Slow_queries | 55 | | Uptime | 2499787 | +--------------------------+------------+
Warning: Pg_query() Query Failed: ERROR: Directories: Permission Denied
I've ran into a wierd problem with my script, and i'm quite dumfounded. I'm doing a PHP interface to create directories into a filebank. The idea is that the directories are virtual, they don't truly exist in the server. The directory names are saved into a PostgreSQL table, in quite simple fashion. The wierd problem is that i get the following error message when i try add the directory name into the database: Warning: pg_query() query failed: ERROR: directories: Permission denied. in /var/www/html/okartek/inc/class_psql.php on line 50 The sql is done by a class, called by this function: PHP Code:
CMS - Blocking Users From Certain Users
I'm created a content managment system and the only thing I can completed is a login script (most important) and how to use sessions. Right know, how do you make something that you can add a few users, give permissions like he is allowed to add news and reviews but not features, etc? Would I add something on the each page for inserting to see if they have such permissions?
PHP Saying Error In Mysql Syntax, But Written My Mysql Query Browser!
I have a basic db that I access with MySQL query browser. Everything seems fine to me but I am using this db as part of a php shopping basket and when I try to add an item I get: Notice: Query failed: 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 '>function.extract]: First argument should be an array in functions.inc.php on line 31 Notice: Undefined variable: price in functions.inc.php on line 36 Notice: Undefined variable: price in functions.inc.php on line 39 Notice: Undefined variable: total in unctions.inc.php on line 39 I'm assuming the last three are caused by this problem as price should be passed to the cart, and total is worked out using it. However although I know mySQL code it was the MySQL query browser that actually generated the code and I cannot see a way to view or debug the code. The db has one table in it which is made up of id, name, subname, desc, and price. The code in the php file that is being referred to is:
Select Statement - Select Random ID #
I have made up a page that pull info on 13 branches of stores onto one main page. It's basically there to display all the branches on one page... then you click on the one you're interested in and then you go to a more detailed page. Back to the main page. On the top, there's kind of a featured branch that has a bigger picture and bigger title but it's still getting pul pulled from the same table etc etc etc. In order for me to avoid favortism to one branch (and for other branches to start complaining) I want to ramdomized the order every time someone came to page but I have no idea how. right now I have a super simple select statement.
|