473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

this warning occur and record not display

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. //Define your database connections and select your database want to use. In this example I use two connections and two DBs. But you can use more than two.
  4.  
  5. //MySQL Server 1
  6. $dbhost1 = "localhost";
  7. $dbuser1 = "root";
  8. $dbpassword1 = "";
  9. $db1 = "mediteam";
  10. $connection1 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
  11. mysql_select_db($db1,$connection1);
  12.  
  13. $db2 = "mediteam_medical";
  14. $connection2 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
  15. mysql_select_db($db2,$connection2);    
  16.  
  17. //The SQL statement
  18. //$sql =" SELECT mediteam.mediteam_area.Area_name AS field1, mediteam_medical.mediteam_medical_medical.fieldname2 AS field2 FROM mediteam.mediteam_area,mediteam_medical.mediteam_medical_medical";
  19.  
  20. $sql =" SELECT mediteam.mediteam_area.Area_name AS, mediteam_medical.mediteam_medical_medical.fieldname2 AS field2  field1 FROM mediteam.mediteam_area,mediteam_medical.mediteam_medical_medical";
  21.  
  22. //Execute query and collect results in $results
  23. $results = mysql_query($sql);
  24.  
  25. //Print result until end of records
  26. while($rows = mysql_fetch_array($results)){
  27.     print $rows["field1"]." | <br>";
  28. }
  29.  
  30. ?>

this warning occur and record not display

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\MediTeam\Medical\a.php on line 26
Apr 29 '15 #1
2 1246
Dormilich
8,658 Expert Mod 8TB
your query fails because of an SQL syntax error.
Apr 29 '15 #2
Dormilich
8,658 Expert Mod 8TB
with a little formatting, it becomes obvious:
Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2.     mediteam.mediteam_area.Area_name AS, 
  3.     mediteam_medical.mediteam_medical_medical.fieldname2 AS field2  field1 
  4. FROM 
  5.     mediteam.mediteam_area,
  6.     mediteam_medical.mediteam_medical_medical
Apr 29 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: prashna | last post by:
Hi all, I am new to C and I am working on some simple programs.I am getting the following warning which I am not able to find what it is, please let me know what is causing this warning.Also What...
2
by: blackswift | last post by:
hello ,all i got this warning: under emacs using GCC 4.0.1 gpp(DJGPP) compiler: gpp -Wall -g lizards.cpp Invalid keyboard code specified lizards.cpp: In function 'int maxflow(int (*), int,...
3
by: rdufour | last post by:
Dim Myfiles() as string Myfiles(0) = "filename1" I get a warning on line myfiles(0)=.. that myfiles has been used before it has been assigned a value a null exception may occur. Obviously this is...
6
by: srikar | last post by:
Hi in C can any one suggest me the way in which the array of structures needs to be declared , with out mentioning the size of the array. eg like static struct rwtable { /* reserved...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.