I'm building a web app that will (ideally) allow users to follow discussion threads (which are in Q&A format like this site), but also follow other content types, such as firms and schools that have profile pages. (The site is intended to help with professional job-seeking, so the back-end provides a bare-bones profile page for firms, s...
I am trying to insert rows into a table that has no unique field or primary key. How can I write a query that will simply ignore the insert if there already exists a row with the exact same values on all fields -- a duplicate row?
Thanks.
...
Let me explain what I mean with that question:
Lets say I have to tables like these:
customers
id customer location
1 Adam UK
2 Pete US
values
id value
1 10
1 7
2 3
2 41
Let's ignore here for a moment that that (and the following query) wouldn't make a lot of sense. It's meant as a simplified example.
Now, if ...
Hi. I have a site where all users need to sign up with username and password. Today I added the phpBB forum to my site. The problem is that users need to sign up for my site and the phpBB form separately. Can I just add to the phpbb_users db with php at the same time as they register for my site?
In that case I need to know what kind o...
I have a CakePHP application where I am trying to get a count of how many of each type of post a user has. I am also using the paginate helper to display all the user's posts on their profile.
I could:
1) Make a find('all', $conditions) request for all the user's posts then parse that for the counts I need (by going post by post and chec...
Hello,
I would like to take images from library, or camera and upload them to a remote server, where I could then retreieve a URL for each image uploaded.
Im looking to get started from scratch. And am looking for some help on where to start.
Im need to do this the simplest way, php and mysql.
Where should I start?!
Also, I rather no...
I have a column of numbers in a MySQL database, along with a timestamp column and other stuff. I want to know the average of all of the values within a set parameter (say, within the last week), and I also want the average of all of the values that are >= X during that same timeframe. So, if my X is 10, and my values are:
0 0 10 15 20, t...
I want to create my site and in the page have it so that the forum pages will use the forum mysql user having privileges on mydb.forum_table, mydb_forum_table2.
and the profile page to use the profile user having access to mydb.users and mydb.profiefields
and so on with the photogallery, blog, chat and...
is this the right way to do it!...
The hibernate manual says this:
String sql = "SELECT ID as {c.id}, NAME as {c.name}, " +
"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} " +
"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID";
List loggedCats = sess.createSQLQuery(sql)
.addEntity("cat", Cat.class)
.addEntity("mother", Cat.class).l...
Hi,
I've just setup MySQL Workbench 5.2.25 CE on a PC with windows XP service pack 3
When trying to create a new server instance on the localhost, Workbench ask me for a root password regarding the service. I've have not been asked during the setup process to enter a password for root... leaving the password blank (or even inputting a ...
Hello ALL,
I have following table structure
table_country ==> country_id (PK) | country | status
table_department ==> department_id (PK) | department | country_id (FK)
table_province ==> province_id (PK) | province | department_id (FK)
table_district ==> district_id (PK) | district | province_id (FK)
NOTE: all tables engine are inn...
I am parsing an XML feed into a MYSQL table using simplexml_load_file(). Some of the variables are blank, I would like them to be actual NULL instead of NULL, or is there even a difference?
$xml = simplexml_load_file('cb.xml') or die ('Bad XML File');
foreach($xml->item as $item) {
$name = $item->name;
//Tried
if ($name == '') {
...
Hi All,
I want a search functionality in my application for the data like following
topic_id tag
1 cricket
1 football
2 football
2 basketball
3 cricket
3 basketball
4 chess
4 basketball
Now when i search for term cricket AND football o/p should be
topic_id
...
i am building an affiliate system and i have stacked with the design of the database in one part. I dont know how to keep track on that who recruited whom. Lets say we have something like this:
Jon smith
Alex Del
Jim West
Marko Polo
Johny Bravo
Pit Sampras
Sara Mat
Gabriella white
Antonio Santo
Maja Grozdanova
Agon Xhela...
hi everyone
can you give me an idea about how to implement chat room using PHP and MySQL
Thanks
...
Possible Duplicate:
What is the best IDE for PHP ?
Hello again everybody,
I finish my work placement next week and have over a month off before I start my studies again. Being the super cool party animal that I am I have decided to use the time getting a firmer grip on PHP. I recently bought the highly recommended book 'PHP ...
Tables are: user_table(user_id, user_name) , votes_table(id,user_id, vote_date, votes)
$sql = SELECT user_id, sum(votes) AS sumvotes, vote_date
FROM votes_table
WHERE vote_date > 1279749600
ORDER BY sumvotes DESC
LIMIT 10
$result = query($sql)
foreach user_id in $result
$sql = SELECT user_id, username
FROM ...
I want to write a program which will backup an entire drive in a MySQL server using java, but I am confused.
How do I create the table (what data types?), how do i insert the row like what should be the primary key, and what should be the max size of each file be?
If you have any suggestion please help me out. Thank you for sparing yo...
Hi,
I am trying to display a table which contains 8500 records, I am using the same controller/model functions as I have used throughout the site which all work fine.
On this page however, I just see a blank screen. Is this a known Issue with codeigniter? Is there a work around? I am totally stumped, my only option I guess is to split ...
I keep getting the error randomly:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Anyone got ideas?
ERROR: java.sql.Connection - Error calling Connection.setAutoCommit:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from ...