![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
bubblegum.anarchy
-
Posts
526 -
Joined
-
Last visited
Never
Posts posted by bubblegum.anarchy
-
-
SELECT * FROM guestbook WHERE titleID = {$titleID}
$titleID would first require approriate injection protection if the value is being passed from browser input.
something like settype($titleID, "integer"); to ensure that $titleID holds an integer rather than malicious mysql code.
-
-
Define the format in mySQL with str_to_date()
UPDATE table SET date = date_format(str_to_date(date, '%Y-%d-%m'), '%Y-%m-%d')
-
no no - post the string stored in the variable $sql during the files processing, not the entire files code.
-
um.. I don't know, how about replace ENGINE with TYPE.
EDIT: FYI - the above create query works perfectly fine via SQLyog
and also try removing the backticks from the KEY column names:
KEY `group_id` (group_id),
KEY `forum_id` (forum_id)
-
Remove the space between the closing paranthesis and the word ENGINE.
-
Open the sql dump in vim and see whats what.
-
well.. the error is near the weird characters:
MySQL: You have an error in your SQL syntax near '-- phpMyAdmin SQL Dump CREATE TABLE `bbnboard_auth_access` ( `group_id` med' at line 1
-
Remove the line that is causing issues since the issue appears to be related to the commenting prefix in a commented line.
-
so then how to insert all the values of a list into a mysql table.
One insert at a time for each value in the select box.
-
Post the string stored in $sql.
-
This was extremely tough:
SELECT games.division, games.user, sum(games.payout) FROM games INNER JOIN ( SELECT substring_index(group_concat(pkey ORDER BY games.division, games.user, games.payout DESC), ',', 3) AS top_three_pkey FROM games GROUP BY games.division, games.user ORDER BY games.division, games.user, games.payout ) AS top_three ON find_in_set(games.pkey, top_three_pkey) GROUP BY games.division, games.user
-
There is no problem - the $_POST data is supposed to only hold one item, the selected item, this is the purpose of the $_POST data.
-
yeah, try REPAIR TABLE
-
-
yeah, apply mysql_real_escape_string() to each $_POST value and add quotes.
... and the ending paranthesis is missing.
-
ORDER BY defaults to ASC - no need to explicitly define the sort direction.
isar21: post the complete SQL query, and also where the $select, $from, $where and $how variables are combined.
-
$_POST['typeList'] holds one item, the selected item.
-
Make no difference compared to what?
The number of records in a table is more costly than the number of tables in a database, afaik.
-
SELECT sum(Time_Taken) FROM call_event WHERE call_id = $call_ID
-
$count_query = mysql_query('SELECT COUNT(*) FROM table'); $getcount = mysql_fetch_row($count_query); $count = $getcount['0']; vs. $count_query = mysql_query('SELECT * FROM table'); $count = mysql_num_rows($count_query);
One record is loaded into memory vs all the records loaded into memory
$query = mysql_query('SELECT * FROM table'); if (!$query) die(mysql_error()); vs. $query = mysql_query('SELECT * FROM table') or die(mysql_error())
not a great deal or difference - readability mostly.
-
Sessions can also store the shopping progress and when complete be placed into the database as a more permanent record.
-
Probably one of the best aspects of MySQL procedures is the ability to move all the common database abstraction done in php (or whatever language) back to the more appropriate location of MySQL. So instead of a php file that contains a common function to return account details, the same function can be defined in a procedure and used simply in php or any other language base.
-
So I am putting the condition like t1.fld_name = <some_val> and this does not match with any row. If I am having count(t1.field1), it shall get count "0" for that row, but it is not generating result for that row.
Why are you expecting a result if you are getting a zero row count ?
How to do all this?
in MySQL Help
Posted
How is this related to mySQL?