Search Results

Showing results 1 to 40 of 123
Search took 0.02 seconds.
Search: Posts Made By: nav33n ; Forum: MySQL and child forums
Forum: MySQL 19 Days Ago
Replies: 5
Views: 442
Posted By nav33n
Congrats on solving your problem. I am glad you learnt something new :)

If you post your answer, even others may get to learn something from this thread.
Forum: MySQL 19 Days Ago
Replies: 5
Views: 442
Posted By nav33n
Seems like you didn't read the member rules. (http://www.daniweb.com/forums/faq.php?faq=daniweb_policies)
Ch, ch. Read more on count and group by clauses. After reading them, you will be able to...
Forum: MySQL 19 Days Ago
Replies: 9
Views: 542
Posted By nav33n
Dude, datatype as in int, varchar, date, datetime, etc.

ALTER TABLE clown_contest MODIFY COLUMN `location` varchar(40) AFTER `state`

Clear ? :)
Forum: MySQL 20 Days Ago
Replies: 9
Views: 542
Posted By nav33n
You forgot the datatype! (doh, even I forgot it in the syntax).
Sorry, here is the right syntax.

ALTER TABLE tablename MODIFY COLUMN columnname datatype AFTER columnname

This works for sure!
Forum: MySQL 20 Days Ago
Replies: 9
Views: 542
Posted By nav33n
Hey, sorry. I misunderstood the question.

/*
ALTER TABLE tablename MODIFY COLUMN columnname AFTER columnname
*/
Eg. ALTER TABLE members MODIFY COLUMN date_of_birth date AFTER username
...
Forum: MySQL 21 Days Ago
Replies: 9
Views: 542
Posted By nav33n
Very simple.

ALTER TABLE tablename ADD columnname datatype AFTER columnname
Forum: MySQL 33 Days Ago
Replies: 4
Views: 499
Posted By nav33n
Hi, can you elaborate your question ?
If you are inserting the value to the table from php, you can use substr (http://php.net/manual/en/function.substr.php) to insert only a part of a string. If...
Forum: MySQL May 22nd, 2009
Replies: 2
Views: 2,286
Posted By nav33n
You should escape ' before adding it to the database.
Use,

$link = mysql_real_escape_string($_POST['link']);
$sql="INSERT INTO catalog (link)
VALUES ('$link')";

You got that error...
Forum: MySQL Apr 22nd, 2009
Replies: 3
Views: 930
Posted By nav33n
All the directories will be in data folder under mysql directory. If you have installed WAMP, for example, the databases will be in c:\wamp\mysql\data :) Look for data directory.
Forum: MySQL Apr 22nd, 2009
Replies: 14
Views: 1,489
Posted By nav33n
1. I would never use form element's names like, Y M D, ie., with spaces. Try,

<input id="dmy" name="dmy" type="text" />

And in the php script,

$date =...
Forum: MySQL Apr 5th, 2009
Replies: 6
Solved: Warnings
Views: 688
Posted By nav33n
You can use @ before mysql statements to supress the warning and error messages.
@mysql_connect(...)
Forum: MySQL Apr 5th, 2009
Replies: 6
Solved: Warnings
Views: 688
Posted By nav33n
This is a comparison operator and you are comparing if the value of $conn_server is "true". So, you should use == instead of =.
Apart from that, I don't see anything wrong with your code which...
Forum: MySQL Apr 3rd, 2009
Replies: 1
Views: 504
Posted By nav33n
Please post your code and explain your problem in detail. Use [code] tags to wrap your code.
Forum: MySQL Apr 3rd, 2009
Replies: 3
Views: 824
Posted By nav33n
Forum: MySQL Apr 3rd, 2009
Replies: 3
Views: 824
Posted By nav33n
escape single quotes and forward slashes by using mysql_real_escape_string. This will prevent sql injections as well.
Ie.,

$leavetype = mysql_real_escape_string($leavetype);
$fullday =...
Forum: MySQL Mar 4th, 2009
Replies: 17
Views: 1,457
Posted By nav33n
Yeah.. 1 solution, good. 2 solutions, better :)

Get some sleep dude! Cheers!
Forum: MySQL Mar 4th, 2009
Replies: 17
Views: 1,457
Posted By nav33n
@Dickersonka, I have been advised on so many occasions not to use joins. Joins are relatively slower compared to subqueries. This is what I have read.
Forum: MySQL Mar 4th, 2009
Replies: 17
Views: 1,457
Posted By nav33n
Subqueries are even better.. :)

select `user_id`, (select count(`comment`) from `comments_table` where `comments_table`.`user_id`=`users_table`.`user_id`) AS `xcnt` FROM `users_table`
GROUP BY...
Forum: MySQL Mar 4th, 2009
Replies: 17
Views: 1,457
Posted By nav33n
I modified your query a little bit and I don't know why it doesn't return users who have post = 0.

SELECT COUNT(
COMMENT ) AS `post_count` , (

SELECT `user_id`
FROM `users_table` u
WHERE...
Forum: MySQL Mar 4th, 2009
Replies: 17
Views: 1,457
Posted By nav33n
Nice queries.. But still, that wouldn't solve what OP is looking for.. The still doesn't return the count as 0, if a user doesn't have any posts. I created dummy tables to create the same scenario...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
After

$result = mysql_query("SELECT * FROM clients WHERE clientID=$_POST[bookingID]");

Use
if(mysql_num_rows($result) > 0 ) {
// record exists.. Do whatever you want to do with that record...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
Use mysql_num_rows($result)
For example,

$query = "select *from table where id='".$_POST['id']."'";
$result = mysql_query($query);
if(mysql_num_rows($result) > 0 ) {
//record exists
} else...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
Emm.. You can mark this thread as solved if all your questions have been answered. If you are extremely happy with Maxmumford's help, you can add to his reputation. Click on 'Add to MaxMumford's...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
It wont. You have to save it in varchar datatype, which again would cause you problems. For example, you can't sort the fields on date. You can't calculate the difference (or add) x number of days to...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
My suggestion is, store date in YYYY-mm-dd format itself. You can change the format using php's date function. As maxmumford has already mentioned, you can convert that date to unixtimestamp and use...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
Hmm.. Okay! From what I have read so far, this is what STR_TO_DATE do.

STR_TO_DATE(date_string, format);

STR_TO_DATE function will format string and insert it to the date column. The second...
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
echo your query. Execute it in phpmyadmin. See what's the exact error.
P.S. I tried to work with str_to_date and I simply can't get it to work ! :-/
Forum: MySQL Mar 2nd, 2009
Replies: 34
Views: 4,376
Posted By nav33n
<?php

// open database connection code and then my code as follows

$sql="UPDATE bookings SET startdate...
Forum: MySQL Feb 28th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
How does your code look like ?


P.S. I will be out of town for 3 days, so, If not me, someone else will help you with your problem :)
Forum: MySQL Feb 27th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
First, query the table and get all the details of that particular bookingID and then display it. You can also give an option for the user saying something like, "Are you sure want to delete ?" :)...
Forum: MySQL Feb 27th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
<?php
// open database connection code and then my code as follows

//$id = mysql_insert_id(); << This line wouldn't work ie., $id will be null because there isn't any insert statement before...
Forum: MySQL Feb 26th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
I can't explain you any better :( Post all the relevant code here. And please use [code] tags.
Forum: MySQL Feb 26th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
Well, You can do it in quite easily. Before redirecting them to the page where they book a room, use $last_inserted_mysql_id = mysql_insert_id(); to get their clientID.
After getting their...
Forum: MySQL Feb 26th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
Where are you inserting the value to client table ?
Forum: MySQL Feb 26th, 2009
Replies: 14
Views: 3,781
Posted By nav33n
last_insert_id() (http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html) in mysql or mysql_insert_id() (http://in2.php.net/mysql_insert_id) in php gets the value of the autoincrement field...
Forum: MySQL Feb 26th, 2009
Replies: 4
Solved: Image Link
Views: 487
Posted By nav33n
Great! Cheers :)
Forum: MySQL Feb 26th, 2009
Replies: 7
Views: 1,129
Posted By nav33n
Yeah. Try it out. :)
Forum: MySQL Feb 26th, 2009
Replies: 4
Solved: Image Link
Views: 487
Posted By nav33n
You are doing it wrong.. $result = mysql_query($query); This will execute the query and return the result resource. You have to then use mysql_fetch_array...
Forum: MySQL Feb 26th, 2009
Replies: 7
Views: 1,129
Posted By nav33n
When adding the data to the table, use nl2br (http://in.php.net/nl2br) function (if you are using php).
Forum: MySQL Feb 4th, 2009
Replies: 1
Views: 532
Posted By nav33n
If you 'investigate' properly in phpmyadmin, there is an option exactly below the table's structure to add a new column. You can specify the columnname, its datatype and mention "auto_increment"...
Showing results 1 to 40 of 123

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC