Hi,
I have a mySql database i want to display only 10 words from its body field which contain html codes, How i can do that, is there any php function to do that.
Currently im just using something like:
in the DB Table:
access: home,register,login
and then in each page:
if(!Functions::has_rights('content'))
{
Functions::noAccess();
}
is there more efficient way to do it, php & MySQL? i may want to gain access even to several parts a page, for example: user can read a page, but doesnt comment to it, and I dont want to build a separate system to each module.
Thanks in advanced, Tal.
i am connecting to mysql from excel using odbc. the following illustrates how i am updating the rs
With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("datapath") = dpath
.Fields("analysistime") = atime
.Fields("reporttime") = rtime
.Fields("lastcalib") = lcalib
.Fields("analystname") = aname
.Fields("reportname") = rname
.Fields("batchstate") = "bstate"
.Fields("instrument") = "NA"
.Update ' stores the new record
End With
the question is why is there a need to run cn.execute after this? havent i already updated the rs with rs.update?
$resultnx = mysql_query("SELECT * FROM `emails` WHERE `email` = '{$email}'");
$num_rows = mysql_num_rows($resultnx);
gets this warning Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ....
Can any one please let me know the best way to use IF statement in mysql query to show if the "email" field is NULL then it should show as "no email"...
Postcode Telephone Email
----------------------------------------------------------
BS20 0QN 1275373088 no email
BS20 0QN 1275373088 no email
PO9 4HG 023 92474208 [email protected]
SO43 7DS 07801 715200 [email protected]
----------------------------------------------------------
I want to set the value of the column 'character_hold' to 'no' for all my rows in my MYSQL database. Is there a SQL statement I can use in phpmyadmin to set them all to 'no'?
I am confused, I don't know what's wrong. I'm about to transfer all data from my first table to the other. Here is my code:
$getdata = mysql_query("SELECT Quantity, Description, Total FROM ordercart");
while($row = mysql_fetch_row($getdata))
{
foreach($row as $cell){
$query1 = mysql_query("INSERT INTO ordermem (Quantity, Description, Total) VALUES
($cell)",$connect);
}
mysql_free_result($getdata);
}
I get the error: Warning: mysql_fetch_row(): 5 is not a valid MySQL result resource.
How should I go about adding slashes to only single quotes and ignoring double quotes?
I am using php. I would only like to escape single quotes to prevent my php mysql queries from breaking.
Thank you!
I have a table of customers with a 1 recorded against their customerid on different dates.
I would like to find the sum of the 1's recorded in descending order. I'm using MySQL and php
Thanks
Is there a simple :) and efficient way or reading very large number of rows sequentially using Zend_Db?
Basically I need to process entire table, row by row. Table is large, primary key sequence is not guaranteed(i.e. not an autoincrement, but is UNSIGNED INT).
What's the best way to approach this?
Environment: PHP 5.2, Zend Framework 1.10, MySQL 5.1
i am creating a marks management system using php & mysqlwhere the concerned faculty will be able to login and enter the marks of the students. i can go with a simple table but the problem is there are 288 different subjects for which marks must be entered. So creating a mysql table with so many subjects does not look good for me. please suggest me the best way to manage user permissions so that only the corresponding faculty will be able to enter marks
hi,
i am using php,mysql,jquery.
When a user clicks on save i go to back end and save data and show the response. once show the success i need to disable the save button for say 1 min. how do i do it.?
I'm running mysql5 on Mac os x 10.5.8 and got this error.
How do I solve this?
The DB worked fine but stopped working after system update.
I think its something related to the socket file which is /tmp/mysql.sock
do I need to give it special permissions and owner?
Thanks
Currently I am using mysql to log all traffic from all users coming into a website that I manage. The database has grown to almost 11m rows in a month, and queries are getting quite slow. Is there a more efficient way to log user information? All we are storing is their request, useragent, and their ip, and associating it with a certain website.
Hi,
I have two tables table1 and table2, i need to write a select query which will list me the columns that exist in both the tables.(mysql)
I need to do for different tables (2 at a time)
Is this possible?
I tried using INFORMATION_SCHEMA.COLUMNS but am not able to get it right.
I have CMS table that contain CMS_STARTTIME and CMS_STOPTIME (attachment).
I want to create report to summarize exist data by using Date, Time and Year as Parameter (attachment).
I don't know how to create sql statement to meet this requirement. I'm using MySQL and MS-SQL.
Does one can help?
Thank you very much.
how do i organize country data (countries, states and cities etc) in mysql?
cause every country has 3 tables: countries, states and cities.
should i have each country in separate set of tables or should i have them all in these 3 tables? if i have all of them in same tables, im afraid that the amount of rows will be huge cause i tend to have a lot of countries!
what is best practice for this?
What is the best way to store users passwords in a MySQL database using PHP. For example, md5 or is there something better? examples would be much appreciated.
When I run some php code I've written, I get the following message:
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 'condition,
price, name, email) VALUES('Fake
Title', 'Fake Subhead', 'Fake Author'
at line 1
I do not see anything wrong with my syntax, however, which is like:
mysql_query("INSERT INTO table (x1, x2, x3) VALUES('$y1', '$y2', '$y3')");
Any ideas?
Hi,
I am storing images in mysql Db directly. what is the best way to display the image in good quality (thumbnail and original size images) using php.
My table has records for every minute (for instance the column name is date), now I want to fetch records with an interval of 5 minutes!
Can it be done at database level?
I am using Django with MySQL
I develop applications using PHP and MySQL. They're not trivial, though they're not too complex. As an example to that I have written an online application to enable football administrators manage the player, competition and judiciary processes.
Separately to that I have used Joomla to create websites for small businesses.
I'd like to be able to use Joomla as my online application development environment. Is there a way I can use Joomla for that?
I want to create a monthly payment system for community members, at this point I have figured out that I need the following tables in my mysql database.
Edited
Users table
user_id, first_name, last_name
Payment table
payment_id,user_id,amount,due_date,payment_date,total
What I need to display list of users who did not pay 6th of every month.
How do I do this? And once the last day of the month is reached, how do I move to the next month?