Menu

[2eb2a2]: / dbsync_currentversion.inc.php  Maximize  Restore  History

Download this file

43 lines (34 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include_once('utils/compatibility.inc.php');
setCompatibility(0);
function dbsynccurrentversion($projectname, $projectid, $echoing) {
if ($projectname!="") {
// retrieve and overwrite project id
$queryproj="SELECT * FROM tbproject WHERE name='$projectname'";
$resultproj=mysql_query($queryproj);
$projectid=mysql_result($resultproj,0,"id");
}
$query="SELECT * FROM tbmoduleproject where project_id=$projectid";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
$maxversion = 0;
while ($i<$num) {
$moduleid=mysql_result($result,$i,"module_id");
$query2="SELECT * from tbmodule where id=$moduleid";
$result2=mysql_query($query2);
$id=mysql_result($result2,0,"id");
$name=mysql_result($result2,0,"name");
$description=mysql_result($result2,0,"description");
$create_dt=mysql_result($result2,0,"create_dt");
$lastversionnr=mysql_result($result2,0,"lastversionnr");
if ($echoing==1) {
echo "module$i.name = $name\n";
echo "module$i.version = $lastversionnr\n";
}
if ($lastversionnr>$maxversion) $maxversion=$lastversionnr;
$i++;
}
return $maxversion;
}
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.