Hi,
I read some articles that promoted the use of the new ext/mysqli in php due to it's support of character sets. I currently use ext/mysql and use SET NAMES UTF-8 to ensure all my data is stored as utf-8. isn't that charset support in ext/mysql or am I missing something larger?
Thanks :)
...
In the codeigniter manual writes the following.
$this->db->select() accepts an
optional second parameter. If you set
it to FALSE, CodeIgniter will not try
to protect your field or table names
with backticks. This is useful if you
need a compound select statement.
$this->db->select('(SELECT SUM(payments.amount) FROM paym...
I have a form where i have many music genres. An artist can be singing under many genres. I have put the genres in checkboxes. Now i need to store the values of the checkboxes in to a single field.
Can some one help me out with some code snippet as i am new to php programming?
...
I have a function on my site where people can vote on photos. Everytime someone click the vote-button my script adds a row in a table (mysql).
Each row looks like this: (Table name = likes)
id --------- userId --------- photoName --------- date
1 ----------- 21 -------------- 34234 ----------- 20100101
How do i find the top 10 photo...
I'm not sure if i made a mistake in logic.
If i have a query and i do an inner join with a null value would i always get no results or will it ignore the join and succeed? example
user { id PK, name NVARCHAR NOT NULL, banStatus nullable reference }
if i write and u.banStatus i will receive no rows?
select * from user as u
join banst...
how to add multiple records in mysql using php. Is using array the only solution to this problem. Because I tried using array but the record that would be added in the database would look like this:
array
...
is there a way to write an sql query that finds all rows where the field value is a substring of a given string.
Example:
table names
Name | Nickname
rohit iamrohitbanga
banga rohitnick
sinan unur
query should be something like
select * from names where Name is a substring of "who is rohit...
I searched for this here and on google and surprisingly couldn't find an answer. I tried to create syntax to submit to mysql that would create multiple tables with the same columns, but it returned an error. Can you point out what is wrong with my syntax, or if this is even possible?
CREATE TABLE news, life
(
id int PRIMARY KEY AUTO_...
I've got the following tables:
Products:
id, name, ...
Products_in_Categories
id, category_id, product_id
Categories
id, name, ...
I have an admin page where I want to let him search products by name, catalog id etc. And of course by category and name and catalog id ...
So without the category - it's really easy. But when I w...
Please I don't have any idea. Although I've made some readings on the topic. All I know is it is used to make the data in the database more efficient and easy to handle. And It can also be used to save disk space. And lastly, if you used normalization. You will have to generate more tables.
Now I have a lot of questions to ask.
First,...
Is there any reason why you should or shouldn't name your form fields exactly the same as the HTML fields?
<input type="text" name="my_field_1" id="my_field_1" /> --> mysql row my_field_1
or
<input type="text" name="myField1" id="myField1" /> --> mysql row my_field_1
The only thing I can think of are probably naming conventions for...
how to make a login form in php. I just need to validate a user stored in the database. Please, I don't have any idea on how to make it.
...
How to encrypt user password in php. please explain in a way a beginner can understand.
I already have this sample code:
$password="john856";
$encrypt_password=md5($password);
echo $encrypt_password;
Can you help me incorporate it in my current code, which does not do any encryption.
<?php
$con = mysql_connect("localhost","root...
When I execute statements on the mysql command line, there must be some way to always display how long the command took to execute?
...
I'm writing a php-mysql application. The application allows the user to run a search against the database. When the search is run, if the user clicks on the back button to go back to it after examining an item brought up by it, they are asked if they would like to resend the query (it uses post). Which would rerun the search in the da...
I'm new to the admin side of DBMS and was setting up a new database tonight (using MySQL) when I noticed this. After granting a user a privilege for the first time, another grant is created that looks like
GRANT USAGE on *.* TO user IDENTIFIED BY PASSWORD password
The documentation says that the "USAGE" privilege means "no privileges,...
Someone help me:
$query = "INSERT INTO tbl_users(user, password, password_def, userid, level
, regdate, lastdate, email) VALUES('$username', sha1('$password')
, sha1('$password'), '$userid', '0', NOW(), NOW(), '$email');";
$userid is a ramdon md5 id.
It gives me this error:
posttokenError: Account not created ...
Ok, I'm relatively new to using the mysqlpp library that is used in Visual Studio to connect to a MySQL database and am having trouble trying to convert a vector of type mysqlpp::String to a vector of type int. Does anyone have any experience with mysqlpp and would mind helping me out a little? I've posted an example of what I'm basicall...
I have 4 different queries and each of them return individual unique set of Results.
I need to combine the Query Results with using a single query.
my sample queries are:
1. select cls.* from (calls as cls inner join calls_users as clsusr on cls.id=clsusr.call_id) inner join users as usr on usr.id=cls.assigned_user_id where cls.assigne...
Hello all,
I am moving to another server and now I am getting an implode warning "Invalid arguments passed", the script was working on the old server, does someone know what I am doing wrong???
My code is:
$query ="SELECT keywords,keywords1,keywords2,keywords3 FROM Table ";
$result = mysql_query($query);
while ($row = mysql_fetch_a...