| | |
Insert Statement not working?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
I throw the exact same sql statement in phpmyadmin and it works but it does not work with mysql_query.
Ideas?
Ideas?
PHP Syntax (Toggle Plain Text)
$a = "INSERT INTO players (player_id, first_name, last_name, date_of_birth, email, mobile_number, emergency_number, mother_name, father_name, player_number, team_captain, ip_address) VALUES ('', '', '', '', '', '', '', '', '', '', '', '127.0.0.1')" $q = mysql_query($a);
"You never stop learning." - OmniX
•
•
Join Date: Sep 2009
Posts: 525
Reputation:
Solved Threads: 61
0
#2 Oct 6th, 2009
please check (or post here) with the database's table structure too,
the player_id should have been as 'not null'.
put the below code your line 2 -
and post the output of echo here.
the player_id should have been as 'not null'.
put the below code your line 2 -
PHP Syntax (Toggle Plain Text)
echo "=>".mysql_error();
•
•
Join Date: Apr 2009
Posts: 5
Reputation:
Solved Threads: 1
0
#3 Oct 6th, 2009
•
•
•
•
I throw the exact same sql statement in phpmyadmin and it works but it does not work with mysql_query.
Ideas?
PHP Syntax (Toggle Plain Text)
$a = "INSERT INTO players (player_id, first_name, last_name, date_of_birth, email, mobile_number, emergency_number, mother_name, father_name, player_number, team_captain, ip_address) VALUES ('', '', '', '', '', '', '', '', '', '', '', '127.0.0.1')" $q = mysql_query($a);
0
#5 Oct 6th, 2009
Dont know what I did but I solved it... lol
I think I just reconstructed the sql query a different way to give me the same output and it worked.
PS: isnt "" not a NULL but a defined value?
PPS: it wouldnt matter in this case as the PK has AI attached?
I think I just reconstructed the sql query a different way to give me the same output and it worked.
PS: isnt "" not a NULL but a defined value?
PPS: it wouldnt matter in this case as the PK has AI attached?
"You never stop learning." - OmniX
![]() |
Similar Threads
- Problem with insert statement (ASP.NET)
- Insert statement problem in sql server 2005 (MS SQL)
- SQL Insert statement syntax (Visual Basic 4 / 5 / 6)
- insert statement problem (C#)
- Syntax error in INSERT INTO statement, please help (ASP)
- Syntax error in INSERT INTO statement (Java)
- insert statement error (MySQL)
- Its really a problem on INSERT statement (MySQL)
Other Threads in the PHP Forum
- Previous Thread: Interactive Timetable - Assign timeslots
- Next Thread: Email error - PHP
| Thread Tools | Search this Thread |
apache api array beginner beneath binary broadband broken button cakephp checkbox class cms code countingeverycharactersfromastring crack cron curl database date display dynamic echo email error fcc file files folder form forms freelancing function functions google href htaccess html image include incode insert integration ip javascript joomla limit link login mail match menu method mlm mod_rewrite multiple mysql oop pageing pagerank paypal pdf php problem query radio random recursion recursiveloop remote script search server sessions sms smtp soap source space sql strip_tags subversion support! survey syntax system table template tutorial undefined update upload url validator variable video virus web window.onbeforeunload=closeme; youtube





