| | |
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: 539
Reputation:
Solved Threads: 63
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 |
# 5.2.10 ajax alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validator variable video web xml youtube





